简体   繁体   English

带孩子的CSS全球班级问题

[英]CSS Global Class Issue with Child

i have a global class for an html 我有一个HTML的全局类

<div class="wrapper">

<div class="content"></div>

</div>

and the CSS is CSS是

.div { width:auto; display:block }


.content {  width:100px;  height:50px; }

On the .content div, i do not need "display:block" class. 在.content div上,我不需要“ display:block”类。 But Its applying on Runtime. 但是它适用于运行时。 i Have given dispay:inherit; 我已经放弃:继承; but it doesn't work. 但这不起作用。 Is there any Other Way for Removing the Display Style ? 还有其他删除显示样式的方法吗?

.content {  width:100px;  height:50px; display: inline; }

或其他显示属性

You can just do: 您可以这样做:

.content {  width:100px;  height:50px; display:inline }
//or display:none or whatever your standard default is

inline is what the value is by default, see MDN Ref . inline是默认值,请参见MDN Ref

.div { width:auto; display:block }

this might not be working....for the above provided html cos there is not div named class 这可能不起作用....对于上面提供的html cos,没有div名为class

what you can do is 你能做的是

.content {  width:100px;  height:50px; display:inline}

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

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