
[英]Is it possible to unset all properties of an element except a certain one (e.g. the display property) using the all shorthand?
[英]Is display property (e.g. flex or block) needed when element length and width have been set beforehand? [closed]
既然设置长宽大小已经永久设置了元素大小,就不需要添加
display:flex<\/code>或
display:block<\/code>了吧?
取决于你的实际意思。
display 属性通常会影响子元素。 当你使用 display 时,它会修改子元素的行为,有时还会修改它们的宽度(例如
display: flex<\/code>会使子元素的宽度为 100%)。
但是如果你设置了一个特定的宽度,它会被覆盖。
有关显示属性的更多信息: https<\/a> :\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/display
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.