我创建了一些通过“对齐选项”对齐的文本,我想添加文本前导,但第一行文本必须保持在 x:0px y:0px 处。
有人知道从第一行删除行高
标签 ?
https://jsfiddle.net/79f9rcgs/
body {
margin:0;
padding:0;
}
.test {
font-family:"verdana";
font-size:25px;
line-height:150px;
background:yellow;
}
p::first-line {
//line-height:0 !important; //doesn't work
}
Run Code Online (Sandbox Code Playgroud)
编辑:解决方案必须是跨浏览器的,
p:first-line { DOESNT WORK IN MOZILLA FIREROX
line-height:100% !important;
}
Run Code Online (Sandbox Code Playgroud)