I have the following column in my webpage draft, which is based on HTML5 Boil开发者_开发问答erplate and 960.gs:
<div class="grid_2" style="background-color:black;" />
However, when I open the page in Chrome, the column doesn't show up at all, unless I put some kind of content in it, like text or whitespace.
How can I make this work without resorting to desperate solutions like  
?
If you don't need to support IE5.5 or IE6, you can use the CSS2 min-width
property to specify the smallest width you want the column to have.
A div
without content doesn't display because there is no height being inherited from content. If you want it to show up--you need to specify a height of some sort... or just use
<div class="grid_2" style="background-color:black;">
</div>
or
<div class="grid_2" style="background-color:black;height:20px"></div>
Well I would try adding a closing tag, since I don't think that is valid HTML:
<div class="grid_2" style="background-color:black;"></div>
精彩评论