Friday, 27 July 2012

CSS - Adding Glow or Shadow

Hi everyone!!

    Today we'll learn very simple method of adding glow or shadow to the edges of your content...the class mod-content should be applied to the div, table, buttons etc....

It will look as follows:

Here is the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
  <title>Glow or shadow</title>

 <style type="text/css">
 .mod {
.mod .mod-content{
   border:1px solid #eaeaea;
/* x1 = top and left edges; 
   x1a = top right corner; 
   x2 = right and bottom edges; 
   x2a = bottom left corner */
.mod .x1,
.mod .x1a,
.mod .x2,
.mod .x2a {
   background:url(glow.png) no-repeat;
   /* turn off for IE6 or use a GIF */
.mod .x1{
   background-position:0 0;
   top:-10px; /* set to the size of the glow */
   /* set glow to the edges of 'mod' */
   padding:0 10px 10px 0; 
.mod .x1 .x1a {
   background-position:100% 0;
.mod .x2 {
   background-position:100% 100%;
   padding:10px 0 0 10px;
.mod .x2 .x2a {
   background-position:0 100%;

 <body >
 <div id="glow" class="mod">
<span class="x1"><span class="x1a"></span></span><span class="x2"><span class="x2a"></span></span>
   <div class="mod-content">
 <div class="hd">
 <div class="bd">
 <center> <p>Body</p><center>
 <div class="ft">
     <div class="ft-content">

The above code uses image "glow.png". Save the following image by right clicking and then save image as glow.png. Place the image in the same folder as your page or change the path in the css class ".mod .x2a ".

             You may place any content inside the content with class mod-content in the body.  I hope this post was helpful. Keep tuned for other posts to come!!

No comments:

Post a Comment