设置字体阴影
1. html 结构
<h1 class="a">欢迎来到铄洋在线</h1> <h1 class="b">欢迎来到铄洋在线</h1> <h1 class="c">欢迎来到铄洋在线</h1> <h1 class="d">欢迎来到铄洋在线</h1>
2. css 样式
h1 { font-family: Arial, Helvetica, sans-serif; font-size: 4rem; } h1.a { text-shadow: 0.2rem 0.2rem red; } h1.b { text-shadow: 0.4rem 0.4rem 0.7rem rebeccapurple; } h1.c { color: #fff; text-shadow: 0.2rem 0.1rem 0.5rem tomato; } h1.d { text-shadow: -0.4rem -0.3rem 0.7rem rebeccapurple; }