html5設(shè)置文字顏色灰色的方法:使用屬性【text-shadow】向文本設(shè)置陰影,語(yǔ)法為【object.style.textShadow=“2px 2px #ff0000”】。
本教程操作環(huán)境:windows7系統(tǒng)、html5版,DELL G3電腦。
html5設(shè)置文字顏色灰色的方法:
text-shadow
屬性向文本設(shè)置陰影。
-
默認(rèn)值: none
-
繼承性: yes
-
版本: CSS3
語(yǔ)法:
object.style.textShadow=“2px 2px #ff0000”
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>文字陰影</title> <style type="text/css"> p { font-family:Verdana, Geneva, sans-serif; font-weight:bold; font-size:36px; color:#f90; text-shadow:-5px -5px 3px #00f, 5px 5px 3px #333;/* 添加文字陰影 */ } </style> <body> <p>陰影屬性<br /> text-shadow</p> </body> </html>
相關(guān)學(xué)習(xí)推薦:html視頻教程