App下載

文字陰影(凹凸)css實現(xiàn)

猿友 2021-02-23 14:52:41 瀏覽數(shù) (7640)
反饋

文字陰影(凹凸)效果:

微信截圖_20210223145110

代碼內(nèi)容

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>w3cschool</title>

<style type="text/css">

body{

background-color: #ccc;

}

div{

font: 700 80px "微軟雅黑";

color: #ccc;

}

div:first-child{

/* text-shadow: 水平位置 垂直位置 模糊距離 陰影顏色 */

text-shadow: 1px 1px 1px #000,-1px -1px 1px #fff;

}

div:last-child{

/* text-shadow: 水平位置 垂直位置 模糊距離 陰影顏色 */

text-shadow: -1px -1px 1px #000,1px 1px 1px #fff;

}

</style>

</head>

<body>

<div>我是凸起的文字</div>

<div>我是凹下的文字</div>

</body>

</html>

推薦好課:CSS微課、HTML+CSS進階實戰(zhàn)


0 人點贊