gpt4 book ai didi

html - box-sizing : border-box on a

转载 作者:太空宇宙 更新时间:2023-11-04 04:26:00 24 4
gpt4 key购买 nike

我在使用 box-sizing: border-box on aside 元素时遇到问题。下面提供了屏幕截图。

以下是我网站的代码片段:

HTML:

<aside>
<h2 class="widgettitle">No active widgets</h2>
There are no active widgets in this area.
</aside>
<aside>
<h2 class="widgettitle">No active widgets</h2>
There are no active widgets in this area.
</aside>
<aside>
<h2 class="widgettitle">No active widgets</h2>
There are no active widgets in this area.
</aside>
<aside>
<h2 class="widgettitle">No active widgets</h2>
There are no active widgets in this area.
</aside>

CSS:

#footer .top aside {
float: left;
margin-bottom: 30px;
padding-right: 30px;
width: 25%;
box-sizing: border-box;
}

正如您在图片中看到的那样,填充仍在框外。 Firebug 甚至不在 CSS 检查器上显示 box-sizing 属性。

图片:http://s24.postimg.org/x2vl2z1b8/scr.jpg

最佳答案

不幸的是,Firefox 是最后一个仍然需要 box-sizing 前缀的浏览器。只需在 box-sizing 行之前添加 -moz-box-sizing: border-box;,它就可以解决问题。

关于html - box-sizing : border-box on a <aside> element 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18271638/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com