gpt4 book ai didi

css - Chrome 和 Firefox CSS 边框问题

转载 作者:行者123 更新时间:2023-11-28 13:09:52 24 4
gpt4 key购买 nike

您好,我的边框在 Firefox 和 Chrome 中显示时遇到了这个问题。在 Safari 中看起来不错。

fiddle /现场演示在这里:http://jsfiddle.net/hirokotenshi/JhfS8/

Chrome 和 Firefox 中的那个看起来有些参差不齐。
这里: http://i923.photobucket.com/albums/ad77/Chapter-s/Screenshot2013-03-26at43905PM_zps5d62d1c9.png

我的 CSS:

#whatsnew {
margin-top: 50px;
border: 1px solid #D9D9D9;
border-right: 50px solid #d52b1e;
padding: 35px;
-webkit-font-smoothing: antialiased;
font-smoothing: antialiased;
font-family: Verdana;
padding-top: 20px;
padding-bottom: 15px;
}

有人知道我该如何解决这个问题吗?

最佳答案

这实际上是设计使然 - 边框在 Angular 处以对 Angular 线连接,因此您看到的是右边框的边缘逐渐变细以与其他 1px 边缘相交。

我能想到的最佳解决方案是使用包装 div,对其应用 1px 边框,然后将红色边框保留在内部 div 中:

HTML:

<div id="wrapper">
<div id="whatsnew">
<div id="whatsnewtitle">What's new?</div>
<div id="whatsnewcon">
<b>Do you know?</b><br />
<br />
Royal Dutch Shell plc filed its Annual Report on Form 20-F for the year ended December 31, 2012 with the U.S. Securities and Exchange Commission.
<br />
<br />
<div style="text-align: right;">
<a href=""><b>Find out more...</b></a>
</div>

</div>
</div>
</div>

CSS:

#wrapper {
border: 1px solid #D9D9D9;
margin-top: 50px;
-webkit-font-smoothing: antialiased;
font-smoothing: antialiased;
font-family: Verdana;
}
#whatsnew {
border-right: 50px solid #d52b1e;
padding: 35px;
padding-top: 20px;
padding-bottom: 15px;
}

http://jsfiddle.net/JhfS8/1/

(快速而肮脏的 hack...)

如果您想避免包装器右侧出现灰色边框,您也可以将其更改为红色:

    border-right-color: #d52b1e;

...如果您想变得真正聪明,您可以使用position: relative 和负边距将内部div“拉”出边界,所以灰色消失在红色后面:

http://jsfiddle.net/JhfS8/2/

关于css - Chrome 和 Firefox CSS 边框问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15632999/

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