Home > Web Front-end > H5 Tutorial > body text

How to set text color gray in html5

coldplay.xixi
Release: 2023-01-03 09:27:26
Original
8592 people have browsed it

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”
Copy after login
<!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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!