开发者

Empty but styled div in 960.gs

开发者 https://www.devze.com 2023-02-07 06:00 出处:网络
I have the following column in my webpage draft, which is based on HTML5 Boil开发者_开发问答erplate and 960.gs:

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 &thinsp;?


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 &nbsp;

<div class="grid_2" style="background-color:black;">
    &nbsp;
</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>
0

精彩评论

暂无评论...
验证码 换一张
取 消