2

I put a black bordered box (the <div> element whose id is box) in a flex box (the <body> element). If I resize the browser to a smaller size, the scroll bar appears, but I can’t use it to see the top border and left border of the box.

Why is that? If I want to view the whole box using the scrollbar, what should I do?

Here is the code:

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  align-items: center;
  display: flex;
  justify-content: center;
}

#box {
  border: 10px solid black;
  min-height: 700px;
  min-width: 700px;
}
<div id="box"></div>
Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
EFanZh
  • 2,357
  • 3
  • 30
  • 63
  • Instead of `align-items: center` and `justify-content: center` on the container, use `margin: auto` on the flex item. https://jsfiddle.net/me5bdk7c/ – Michael Benjamin Jul 18 '17 at 14:17

0 Answers0