gpt4 book ai didi

html - Border-bottom 在 Chrome 和 Firefox 中不是下划线;在 IE 中工作

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

我有 http://jsfiddle.net/Lijo/FRBqJ/ 中给出的 HTML 代码.在 Internet Explorer 中它工作正常 - 标题文本带有下划线。但在 Firefox 和 Chrome 中,该行不是下划线。

  1. 这种不正确行为的原因是什么?

  2. 我们如何纠正它(使用 CSS)?

火狐

enter image description here

浏览器

enter image description here

HTML

    <div id="searchContainer" class="searchContainer">
<div id="searchHeader" class="searchHeader">
<span id="detailContentPlaceholder_lblSearchHeading" class="searchContentHeadingText">
Business Testing Act</span>
<img alt="Expand" src="Images/PlusIcon.GIF" class="expandSearchIcon" />
<img alt="Collapse" src="Images/MinusIcon.GIF" class="collapseSearchIcon" />
</div>
</div>

CSS

.searchHeader
{
width:100%;
border-bottom:2px solid #fcda55;
padding:0 0 2px 0;
margin:0 0 0 0px;
font:bold 13pt Arial;
line-height:10pt;
color:#00A6B5;
}

引用:

  1. > CSS text-underline rendering difference between FF/IE and Chrome

profile for Lijo at Stack Overflow, Q&A for professional and enthusiast programmers

最佳答案

由于您使用的是 float,因此您还应该将 overflow: auto; 添加到父元素,以便它说明 float 元素:

.searchHeader
{
width:100%;
border-bottom:2px solid #fcda55;
padding:0 0 2px 0;
margin:0 0 0 0px;
font:bold 13pt Arial;
line-height:10pt;
color:#00A6B5;
overflow: auto; /* Right here */
}

演示:http://jsfiddle.net/FRBqJ/1/

关于html - Border-bottom 在 Chrome 和 Firefox 中不是下划线;在 IE 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13133791/

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