CSS3 Shadow Effects Explain
With CSS3 you can add shadow to text and to elements.
Html Code:<!DOCTYPE html>
<html>
<head>
<style>
h1 {
text-shadow: 2px 2px;
}
</style>
</head>
<body>
<h1>Text-shadow effect!</h1>
<p><b>Note:</b> Internet Explorer 9 and earlier versions, do not support the text-shadow property.</p>
</body>
</html>
Html Code Result:
Text-shadow effect!
Note: Internet Explorer 9 and earlier versions, do not support the text-shadow property.
add a blur effect to the shadow:
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
text-shadow: 2px 2px 5px red;
}
</style>
</head>
<body>
<h1>Text-shadow effect!</h1>
<p><b>Note:</b> Internet Explorer 9 and earlier versions, do not support the text-shadow property.</p>
</body>
</html>
Html Code Result:
Text-shadow effect!
Internet Explorer 9 and earlier versions, do not support the text-shadow property.
add a color to the shadow:
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
text-shadow: 2px 2px red;
}
</style>
</head>
<body>
<h1>Text-shadow effect!</h1>
<p><b>Note:</b> Internet Explorer 9 and earlier versions, do not support the text-shadow property.</p>
</body>
</html>
Html Code Result:
Text-shadow effect!
Internet Explorer 9 and earlier versions, do not support the text-shadow property.
white text with black shadow:
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
color: white;
text-shadow: 2px 2px 4px #000000;
}
</style>
</head>
<body>
<h1>Text-shadow effect!</h1>
<p><b>Note:</b> Internet Explorer 9 and earlier versions, do not support the text-shadow property.</p>
</body>
</html>
Html Code Result:
Text-shadow effect!
Internet Explorer 9 and earlier versions, do not support the text-shadow property.
white text with black, blue, and darkblue shadow:
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
color: white;
text-shadow: 1px 1px 2px black, 0 0 25px blue, 0 0 5px darkblue;
}
</style>
</head>
<body>
<h1>Text-shadow effect!</h1>
<p><b>Note:</b> Internet Explorer 9 and earlier versions, do not support the text-shadow property.</p>
</body>
</html>
Html Code Result:
Text-shadow effect!
Internet Explorer 9 and earlier versions, do not support the text-shadow property.
Post a Comment