Download
    Interview Question     &Answer
Main Menu
CSS Margin@ Shwetank education.com
Definition -  The CSS margin properties define the space around elements.

A border has been added to each element so you that you may see the effects of the margin attribute.
{
margin-top:100px;
margin-bottom:100px;
margin-right:50px;
margin-left:50px;
Example
<html>
<head>
<style type="text/css">
p { background-color:red;
} p.margin
{ margin-top:100px;
margin-bottom:100px;
margin-right:50px;
margin-left:50px;
} </style>
</head>
<body>
<p>This is a paragraph with no specified margins.</p>
<p class="margin">This is a paragraph with specified margins.</p>
</body>
</html>

Output
Try it yourself?
Margin - Shorthand property
To shorten the code, it is possible to specify all the margin properties in one property.
Example
The margin property can have from one to four values.
margin:100px 80px 65px 70px;
{ top margin is 100px
right margin is 80px
bottom margin is 65px
left margin is 70px
} Now Sequence in Margin : top, right, bottom, left !



IT  Projects Links
M-Tech Thesis
Php Project
Java Project
Asp.Net Project
Android Project
Vb .Net Project
Html Project

------------------------------- Electronics  Project
Networking
Embedded system
Telecom
Robotics
CCNA
------------------------------- Latest IT  News


Copyright 2010-2015    shwetankeducation.com
Privacy & Terms