Writing: 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!

Here's a container with some child elements:

Flyout menus! The second you need to implement a menu that uses a hover event to display more menu items, you're in tricky territory. For one, they should

"The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect."- Tim Berners-Lee

In this week's roundup: datepickers are giving keyboard users headaches, a new web component compiler that helps fight FOUC, we finally get our hands on styling list item markers, and four steps to getting webmentions on your site.

The short answer: flex-shrink and flex-basis are probably what you’re lookin’ for.

In this week's look around the world of web platform news, Google Search Console makes it easier to view crawled markup, we learn that custom properties

The IndieWeb is a thing! They've got a conference coming up and everything. The New Yorker is even writing about it:


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Atom editor mac version download
The most popular open source editor