Home > Web Front-end > HTML Tutorial > How to use the text-shadow property of CSS3

How to use the text-shadow property of CSS3

php中世界最好的语言
Release: 2018-01-22 10:47:46
Original
2041 people have browsed it

This time I will bring you the text shadow of CSS3text-shadowHow to use the attribute, and the Notes on using CSS3 text-shadow text-shadow What are they? Here are actual cases. Let’s take a look.

Text shadow text-shadow attribute special effects:

1. Lower right corner shadow, lower left corner shadow, upper left corner shadow, upper right corner shadow

<!DOCTYPE html>  
<html lang="en">  
<head>  
    <meta charset="UTF-8">  
    <title>text-shadow</title>  
    <style>  
        p{   
          text-align:center;   
          margin:0;   
          font-family: helvetica,arial,sans-serif;   
          color:#999;   
          font-size:80px;   
          font-weight:bold;   
          text-shadow:10px 10px #333;   
        }   
    </style>  
</head>  
<body>  
    <p>Text Shadow</p>  
</body>  
</html>
Copy after login

If you change text-shadow Change text-shadow to: text-shadow:-10px 10px #333, and the shadow in the lower left corner will appear

Change text-shadow to: text-shadow:-10px -10px #333, and the shadow in the upper left corner will appear

Change text-shadow to: text-shadow: 10px -10px #333, and the shadow in the upper right corner will appear

2. Use text-shadow to set the three-dimensional text effect

<!DOCTYPE html>  
 <html lang="en">  
 <head>  
     <meta charset="UTF-8">  
     <title>text-shadow</title>  
     <style>  
         p{   
           text-align:center;   
           margin:0;   
           font-family: helvetica,arial,sans-serif;   
           color:#999;   
           font-size:80px;   
           font-weight:bold;   
           text-shadow:-1px -1px #fff,   
                                    1px 1px #333;   
         }   
     </style>  
 </head>  
 <body>  
     <p>Text Shadow</p>  
 </body>  
 </html>
Copy after login

I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!

Related reading:

Detailed explanation of examples of HTML text formatting

Summary of frequently used tags in html

How to vertically center img and span in p

The above is the detailed content of How to use the text-shadow property of CSS3. 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