Home  >  Article  >  Web Front-end  >  How to set text color gray in html5

How to set text color gray in html5

coldplay.xixi
coldplay.xixiOriginal
2021-03-03 16:18:528527browse

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"].

How to set text color gray in html5

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn