gpt4 book ai didi

css - Internet Explorer 边框增加空间

转载 作者:行者123 更新时间:2023-11-28 08:33:55 25 4
gpt4 key购买 nike

Internet Explorer 11 以我不理解的方式添加空间。在下面的元素中,它在左边框上添加了空白。 Link to a page that illustrates the problem showing how element is displayed in different browsers

这是代码:

<div style="position:absolute;width:330px;left:30px;top:120px;visibility:visible;border:1px solid black">
<div style="position:relative;height:14px;background-color:#B02C2A;padding:6px 0 6px 8px;color:white;"><span>hejsan</span>
</div>
</div>

删除绝对定位或边框属性使问题消失,但我需要这些功能。有什么我遗漏的或者是错误吗?

最佳答案

<div style="position:absolute;width:330px;left:30px;top:120px;visibility:visible;border:1px solid black">
<div style="position:relative;height:14px;background-color:#B02C2A;padding:6px 0 6px 8px;color:white;"><span>hejsan</span>
</div>
</div>

background-color:#B02C2A; 应用到第一个 div,这样它就不会显示 div 的白色间距

关于css - Internet Explorer 边框增加空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28151839/

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