码迷,mamicode.com
首页 > 其他好文 > 详细

Firefox 的 hack 及 问题

时间:2017-10-12 13:06:27      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:size   pad   wrap   rom   sage   样式   sel   color   white   

 

hack:

@-moz-document url-prefix(){
        #selector{
            display: flex;
            justify-content: space-between;
        }
}

 

问题一:行内元素 a 浮动后,导致位置错乱,暂定原因为父级或本身公用样式设置了  white-space: nowrap;

html:

<nobr>
   <span>通知</span><span id="sel"></span>
</nobr>
<nobr class="nobr">
   <a href="message.aspx" class="moreMsg">更多</a>
</nobr>

css:

.moreMsg{
    /*float:right;*/
    padding-right: 10px;
    padding-top: 5px;
    text-decoration: underline;
    font-size: 13px !important;
    color: #0072c6 !important;    
    
}
.nobr{
    float:right;
}
.ms-titleText.ms-titleText, .ms-titleText > a{
    white-space:normal !important;
}

在 IE7、8、9、10、Edge 及 chrome 下,仅使用 .moreMsgfloat:right; 没有注释的情况下)即可有以下效果:

技术分享

 

而在火狐下,必须去掉加上 

.nobr,
.ms-titleText.ms-titleText, .ms-titleText > a
以上2个类才行,否则会是如下效果:

技术分享

 


 

Firefox 的 hack 及 问题

标签:size   pad   wrap   rom   sage   样式   sel   color   white   

原文地址:http://www.cnblogs.com/JaneBlog/p/7655461.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!