text-shadow属性适用于文本阴影
指定了水平阴影,垂直阴影,模糊的距离,以及阴影的颜色
给标题添加阴影
h1
{
text-shadow: 5px 5px 5px #FF0000;
}
也适用于盒子阴影
div
{
width:300px;
height:100px;
background-color:yellow;
box-shadow: 10px 10px 5px #888888;
}
::before 和 ::after 两个伪元素中添加阴影效果
#boxshadow::after {
content: '';
position: absolute;
z-index: -1; /* hide shadow behind image */
-webkit-box-shadow: 0 15px 20px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 15px 20px rgba(0, 0, 0, 0.3);
box-shadow: 0 15px 20px rgba(0, 0, 0, 0.3);
width: 70%;
left: 15%; /* one half of the remaining 30% */
height: 100px;
bottom: 0;
Text OverflowCSS3文本溢出属性指定应向用户如何显示溢出内容
<div class="test" style="text-overflow:ellipsis;">This is some long text that will not fit in the box</div>
<p>div 使用 "text-overflow:clip":</p>
<div c