Html 继承CSS宽度
你好。我的问题是,我希望Html 继承CSS宽度,html,css,inheritance,Html,Css,Inheritance,你好。我的问题是,我希望.mylargeframe在浏览器的整个宽度上伸展 CSS HTML 测试 问题是它没有被完全填满,但它几乎就在那里。我正在使用Firefox和Chrome替换宽度:auto fieldset { background:#ebeced; border: none; border-top: 1px solid #d0d2d5; border-radius: 0 0 4px 4px; box-shadow: inset 0 1px
.mylargeframe
在浏览器的整个宽度上伸展
CSS
HTML
测试
问题是它没有被完全填满,但它几乎就在那里。我正在使用Firefox和Chrome替换
宽度:auto使用100%
在字段集中编码>
fieldset
{
background:#ebeced;
border: none;
border-top: 1px solid #d0d2d5;
border-radius: 0 0 4px 4px;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
margin: 5px 0 -20px -20px; padding: 18px 20px;
width: 100%;
}
现在,字段集
将占用其父项的宽度
。替换宽度:自动使用100%
在字段集中编码>
fieldset
{
background:#ebeced;
border: none;
border-top: 1px solid #d0d2d5;
border-radius: 0 0 4px 4px;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
margin: 5px 0 -20px -20px; padding: 18px 20px;
width: 100%;
}
现在,字段集
将占据其父字段集的宽度。这样,字段集将填充您的div;)
您需要调整方框大小,否则宽度将为100%+边距这样字段集将填充您的div;)
您需要调整框大小,否则宽度将为100%+边距您在.mylargeframe
上有宽度:80%
。为什么您希望它一直运行?您在.mylargeframe
上有宽度:80%
。为什么你会期望它一直持续下去?
fieldset
{
background:#ebeced;
border: none;
border-top: 1px solid #d0d2d5;
border-radius: 0 0 4px 4px;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
margin: 5px 0 -20px -20px; padding: 18px 20px;
width: 100%;
}
fieldset
{
width:100%;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
}