22 Aug 2015

Learn what is OPACITY in CSS with example

First Create HTML file as given here:

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="css/primary.css">
    </head>
    <body>
        <div class="opacity">
            Text in Here.
        </div>
    </body>
</html>

Create CSS file as given here:

.opacity{
    width: 100px;
    height: 100px;
    background: #000;
    color: #fff;
    padding:10px;
    opacity: 0.2;
    filter:alpha(opacity=70);
}


Share:

0 comments:

Post a Comment