Welcome Login

Css: opacity


The opacity property sets the opacity level for an element.

 

Eg: opacity property sets the opacity level for a div element.

<html>

<head>
    <style type="text/css">
    div {
    width: 300px;
    height: 100px;
    
    background-color:blue;
    opacity: .5;
    } 
    </style>
</head>

<body>
    <div>
        <h1>Hello world</h1>
    </div>
    <h1>Hello world</h1>
</body>

</html>

 

 

Outputs:

css-opacity1


Created on: Friday, October 26, 2012 by Andrew Sin