我只是在玩CSS中的line-height属性。我发现,如果我将两条相同的线的线高设置为0.1,那么它们都将很好地结合在一起。这就是我所做的
<!DOCTYPE html>
<html>
<head>
<style>
p.effect {
line-height: 0.1;
}
</style>
</head>
<body>
<p class="effect">
This is a paragraph with a special line-height.<br>
This is a paragraph with a special line-height.<br>
</p>
<p> This is a normal paragraph.<br>
This is a normal paragraph</p>
</body>
</html>
该行这是一个具有特殊行高的段落,看起来非常漂亮。我的问题是:
这个效果有名字吗?像CSS中的xyz字体或xyz效果?
最佳答案
.short {
line-height: 0.3;
}
p {
text-shadow: 4px 10px 0px rgba(159, 150, 150, 1);
}
<pre class="short">
How the hell is this nice?
This is such a bad sample to create shadow like effect.
But, why would one create a shadow effect by using line-height?
CSS3 now supports text-shadow property where you can have a nice shadow lurking around your text.
This is totally messed up.
I am even using .3 for this height and you're still reading the source to understand what I am saying.
Look below paragraph with a shadow effect.
</pre>
<p>
Isn't this much cooler?
</p>
关于html - 在CSS中设置line-height的效果是什么?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35167623/