以下CSS适用于Chrome,但不适用于Firefox。它会将padding
添加到包含background-color
的文本:
HTML:
<span id="titleheader">EVERYONE ACHES TO MAKE A DIFFERENCE</span>
CSS:
#titleheader {
background: none repeat scroll 0 0 rgba(255, 0, 0, 0.38);
line-height: 140% !important;
padding-left: 0px;
padding-right: 0px;
box-shadow: 10px 0 0 rgba(255, 0, 0, 0.38), -10px 0 0 rgba(255, 0, 0, 0.38) !important;
}
但是Firefox没有执行这部分:
box-shadow: 10px 0 0 rgba(255, 0, 0, 0.38), -10px 0 0 rgba(255, 0, 0, 0.38) !important;
@-moz-document url-prefix() {
#titleheader {
background: none repeat scroll 0 0 rgba(255, 0, 0, 0.38);
line-height: 140% !important;
padding-left: 0px;
padding-right: 0px;
box-shadow: 10px 0 0 rgba(255, 0, 0, 0.38), -10px 0 0 rgba(255, 0, 0, 0.38) !important;
}
}
答案 0 :(得分:0)
这在FireFox
中修复了它您不需要@TylerH
-moz-box-shadow: 10px 0 0 rgba(255, 0, 0, 0.38), -10px 0 0 rgba(255, 0, 0, 0.38) !important;
但你确实需要添加
box-decoration-break: clone;
#titleheader {
background: none repeat scroll 0 0 rgba(255, 0, 0, 0.38);
box-decoration-break: clone;
-webkit-box-shadow: 10px 0 0 rgba(255, 0, 0, 0.38), -10px 0 0 rgba(255, 0, 0, 0.38) !important;
box-shadow: 10px 0 0 rgba(255, 0, 0, 0.38), -10px 0 0 rgba(255, 0, 0, 0.38) !important;
}