简体   繁体   English

HTML不占用垂直空间

[英]HTML   not occupying vertical space

I want my   我要我的  to occupy the vertical space of its parent DIV. 占据其父DIV的垂直空间。 It's being rendered in the markup but it doesn't occupy the vertical space. 它正在标记中渲染,但不占用垂直空间。

I've tried removing the white-space:nowrap style on the DIV. 我试过在DIV上删除white-space:nowrap样式。 I also tried googlearching but came up empty because everything was about DIVs, special chars and tables. 我也尝试过googlearching,但因为所有内容都是关于DIV,特殊字符和表格的,所以空了。

Please post your CSS so we can see what is going wrong. 请发布您的CSS,以便我们可以找出问题所在。 Look at this simple JSFiddle, with only background-color it renders as you want :) 看看这个简单的JSFiddle,它只有背景色,可以根据需要呈现:)

 div { background-color:red; } 
 <div>&nbsp;</div> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM