Thursday 3 November 2011

All CSS Margin Properties


This property is used to set the margin between the elements.

Property
Description
Values
CSS
Margin
A shorthand property for setting the margin properties in one declaration
margin-top
margin-right
margin-bottom
margin-left
1
Margin-bottom
Sets the bottom margin of an element
auto
length
%
1
margin-left
Sets the left margin of an element
auto
length
%
1
margin-right
Sets the right margin of an element
auto
length
%
1
margin-top
Sets the top margin of an element
auto
length,%
1


Example

<html>
<head>
     <style type=”text/css”>               
.test
              {
                        margin-top:10%;
                        margin-left:10%;
              }
     </style>
</head>
<body>
     <center>
<table cellpadding="0" cellspacing="0" border="1" class="test">
                        <tr>
                                  <th>Subject List</th>
                        </tr>
                        <tr>
                                  <td>PHP</td>
                        </tr>
                        <tr>
                                  <td>SAD</td>
                        </tr>
                        <tr>
                                  <td>Vb</td>
                        </tr>
                        <tr>
                                  <td>C++</td>
                        </tr>
              </table>
       </center>
   </body>
  </html>

No comments:

Post a Comment