NEWS: Total Picture Views: 151536 | Total Article Views: 161015 | Top 5 Most Popular Article: 1. Am I Stuck Algorithm with Becker Robot | 2. PickUpThings with Becker Robot | 3. How to read a JSON and work with it | 4. Encrypted Data GUI (Download .Zip) | 5. Create Wall and Things with Becker

Z-Index Example HTML

Description:

In this example I will be showing how to use the z-index in css. You can also view the code working here: Example

Code:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        #square1, #square2, #square3{
            height: 65px;
            width:160px;
            -moz-border-radius: 50px;
            border-radius: 50px;
            text-align: center;
            position: absolute;

        }

        #square1{
            left: 5px;
            background-color: #007700; /* GREEN */
        }

        #square2{
            left: 55px;
            background-color: #0000ee; /* BLUE */
            z-index: 1;
        }

        #square3{
            left: 105px;
            background-color: #ff0000; /* RED */
        }

    </style>
</head>
<body>
    <div id="square1">
        Square 1
    </div>

    <div id="square2">
        Square 2
    </div>

    <div id="square3">
        Square 3
    </div>
</body>
</html>
Attachments: None

Tags: Z-Index

Total Views: 778

My name is Jean-Mathieu

I created this website so other people could enjoy finding useful stuff easier. If you have any question do not hesitate to contact me.

jean8mathieuCreated on 03/07/15


affiliate_link

Disclosure: We are a website that needs compensation to operate like any other website on the internet.
We may receive consideration for our reviews but we are totally unbiased and do not accept paid reviews or fake reviews claiming to be something they are not.