How to write shadow code in css3
Nov 25, 2021 pm 03:08 PMWriting: 1. "Element object {box-shadow: horizontal shadow vertical shadow blur distance shadow size color inset;}", used to add shadow to the element box; 2. "Text object {text-shadow: Horizontal shadow vertical shadow blur distance color;}", used to add shadows to text elements.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
How to write the shadow code in css3
In css, you can set a shadow to the text through the text-shadow attribute. Add one or more shadows to the box via the box-shadow property.
The syntax of the text-shadow attribute is:
text-shadow: h-shadow v-shadow blur color;
The syntax of the box-shadow attribute is:
box-shadow: h-shadow v-shadow blur spread color inset;
Let’s take a look at it through an example:
<!DOCTYPE html> <html> <head> <style> div{ width:300px; height:100px; background-color:#ff9900; box-shadow: 10px 10px 5px #888888; } h1{ text-shadow: 5px 5px 5px #FF0000; } </style> </head> <body> <div></div> <h1 id="文本阴影效果">文本阴影效果!</h1> </body> </html>
Output result:
(Learning video sharing: css video tutorial)
The above is the detailed content of How to write shadow code in css3. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)
