我正在尝试在:之前/之后制作形状:之后。这在Chrome中运行正常,但在Firefox中。有一个小的错位。并在打印时在元素和after选择器之间产生一个小的空白区域。用css对齐形状:之前,:之后
这是它的外观在打印预览与Firefox
HTML
<div class="container">
<div class="topbar">
<div class="text">Text</div>
</div>
</div>
我的CSS
/* Styles go here */
.container .topbar {
height: 15px;
background-color: #91C34F !important;
width: 100%;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.container .topbar .text {
position: relative;
color: #fff !important;
float: right;
top: 3px;
background-color: #91C34F !important;
font-size: 16px;
padding: 8px 80px;
}
.container .topbar .text:after {
height: 0;
content: "";
display: block;
position: absolute;
top: -0.5px;
left: -37px;
border-right: 38px solid #91C34F !important;
border-bottom: 34px solid transparent;
}
这是上面的代码https://plnkr.co/edit/oll1ooap2mKC1EQo0n84?p=preview一个普拉克。
如何在所有浏览器中正确对齐?
尝试使用一个CSS复位--- https://necolas.github.io/normalize.css/ –
会尝试,... –