22 Aug 2015

Learn MARGINS AND PADDING in CSS with example

First create HTML file as given here:

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="css/primary.css">
    </head>
    <body>
        <h1>Page Title</h1>
        <div class="text">
            This is some text
        </div>
    </body>
</html>

Create CSS file as given here:

h1{
        margin-top: 0px;
}
.text{ 
    background: #000;
color: #fff;
    width: 180px;
    height: 80px;
    padding: 0 0 0 0;
}


Share:

0 comments:

Post a Comment