繁体   English   中英

Firefox和Chrome中HTML的不同表示

[英]different represent of HTML in firefox and chrome

我感到困惑:此代码守护程序在Firefox和Chrome中显示不同:

<div style="border:1px solid black;"> 
    <a href="baidu.com" >AA<span style="float:right">BB</span></a>
</div>
a {
    display: block;
    padding: 3px 20px;
    clear: both;
    font-weight: normal;
    line-height: 1.42857;
    color: rgb(51, 51, 51);
    white-space: nowrap;
    border:1px solid red;
}

CodePen: http ://codepen.io/ChinaXing/pen/jwFon

在Chrome中:

在Chrome中

在Firefox中:

在Firefox中

删除样式“空白:nowrap”

AABB

 a {
    padding: 3px 20px;
    font-weight: normal;
    clear: both;
    line-height: 1.42857;
    color: rgb(51, 51, 51);
    border:1px solid red;
}
span {
    float:right;
}

添加text-align:left; overflow:hidden; text-align:left; overflow:hidden; 到锚标签

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM