I believe the div should be 50 percent of the page, unless, for some reason, the text inside the div makes it larger.
min-width
does not set a minimum starting width from which your block will grow; rather it limits how far the block can shrink.
In min-width: 50%;
, the 50%
is in reference to the containing block. I've never used percentages with min-width
, but I find it can be useful with other units. For example if I have a block (like a column of text) that I want to be full width, but I don't ever want it to go below a minimum width, I could use something like {width: 100%; min-width: 250px;}
.
Note the caveats on IE support mentioned by others.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…