background: lightblue : background « CSS « HTML / CSS






background: lightblue

  

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title></title>
        <style type='text/css'>
            div {
                position: absolute;
                padding: 10px;
                border: 1px solid black;
                opacity: 0.9;
                background: #ccc;
                width: 100px;
                height: 100px;
                top: 20px;
                left: 20px;
                z-index: 4;
            }
            div + div {
                background: lightblue;
                top: 40px;
                left: 40px; 
                z-index: 3;
            }
            div + div + div {
                background: lightgreen;
                top: 60px;
                left: 60px;
                z-index: 2;
            }
            div + div + div + div {
                background: pink;
                top: 80px;
                left: 80px;
                z-index: 1;
            }
            </style>
    </head>
    <body>
        <div>div1</div>
        <div>div2</div>
        <div>div3</div>
        <div>div4</div>
    </body>
</html>

   
  








Related examples in the same category

1.'background' Example
2.The background shorthand property provides for specifying all five separate background properties in one single property.
3.background: mistyrose
4.background: gray
5.background: rgb(128, 128, 128)
6.The background-color value can be transparent keyword, which is also the default value.
7.The background-color value can be a hexadecimal value
8.The background-color value can be a short hexadecimal value
9.background: yellow;
10.background: white url('http://java2s.com/style/logo.png') center center; (image and position)
11.background: url('http://java2s.com/style/logo.png') repeat-x; (background-image-repeat)
12.background: url('http://java2s.com/style/logo.png') repeat-y scroll; (background image repeat attachment)
13.background: mistyrose;
14.background: pink;
15.background: lightyellow;
16.background: rgb(234, 234, 234);
17.background: yellowgreen;
18.background: no-repeat fixed bottom center;
19.background x tiled
20.background y tiled
21.Background fixed
22.Whole page background
23.Whole page shading effect
24.HTML and CSS for background colors
25.Using more than one background image
26.Merge several image to one big background image
27.CSS Background Attributes Example
28.Link with background
29.hr border: none; background-color: #256579; color: #256579; height: 2px; width: 80%;
30.tfoot td background: #808080;color: white;
31.background attachment: fixed
32.option background-color: #3CB371;color: #ffffff;
33.code padding:3px; background-color:black; color:#FFFFFF;
34.background-attachment: fixed;
35.demonstrating the background-color property
36.Background grid
37.a:hover {color:#FF9900; text-decoration:underline; background-color:#f9f0f0;}
38.thead, tfoot {border:solid; background-color:#efefef; font-size:36px;}
39.Update background image when mouse hover
40.Using background image for DIV
41.background: url(img/document.gif) no-repeat left center;
42.Change background when mouse hover
43.a:hover background: inherit;
44.Using shade image to as the title bar background
45.Round corner with background image
46.Shading background
47.Blue background
48.Black background
49.background: #ffffff url(1024px-images/background.gif) top center repeat-y;
50.Round corner with background image 2
51.Block quote with background
52.background: rgb(244, 244, 244);
53.The background shorthand property
54.background assigns the padding area inside the box to a background color and/or image.
55.Set URL for Background Image
56.Background with no repeat
57.Add background image to LI
58.background: lightgreen
59.background: pink
60.Css Rollover with image