Home > Article > Web Front-end > How to set text color gray in html5
html5 How to set the text color to gray: Use the attribute [text-shadow] to set a shadow to the text, the syntax is [object.style.textShadow="2px 2px #ff0000"].
The operating environment of this tutorial: windows7 system, html5 version, DELL G3 computer.
html5 Method to set text color gray:
text-shadow
property sets a shadow to the text.
Default value: none
Inheritance: yes
Version: CSS3
Grammar:
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>
Related learning recommendations: html video tutorial
The above is the detailed content of How to set text color gray in html5. For more information, please follow other related articles on the PHP Chinese website!