visitor activity monitorvisitor activity monitor

PROJECT CODE

                                            The Developers Choice!!!!
                                                                                                            Home | About Us | Contact Us

CSS TUTORIALS

Align:

What is Aligning Block Elements
A block element is an element that takes up the full width available, and has a line break before and after it.
How to use Aligning Block Elements
Examples of block elements:
<h1> <p> <div>
What is Center Aligning Using the margin Property
Block elements can be center-aligned by setting the left and right margins to "auto".
Setting the left and right margins to auto specifies that they should split the available margin equally. The result is a centered element:
How to use Center Aligning Using the margin Property
Example
.center {
margin-left: auto;
margin-right: auto;
width: 70%;
background-color: #b0e0e6;
}

What is Left and Right Aligning Using the position Property
One method of aligning elements is to use absolute positioning:
How to use Left and Right Aligning Using the position Property
Example
.right {
position: absolute;
right: 0px;
width: 300px;
background-color: #b0e0e6;
}

   
What is Crossbrowser Compatibility Issues
When aligning elements like this, it is always a good idea to predefine margin and padding for the element. This is to avoid visual differences in different browsers.
There is a problem with IE8 and earlier, when using the position property. If a container element (in our case
) has a specified width, and the !DOCTYPE declaration is missing, IE8 and earlier versions will add a 17px margin on the right side. This seems to be space reserved for a scrollbar. Always set the !DOCTYPE declaration when using the position property:
How to use Crossbrowser Compatibility Issues
Example
body {
margin: 0;
padding: 0;
}
.container {
position: relative;
width: 100%;
}
.right {
position: absolute;
right: 0px;
width: 300px;
background-color: #b0e0e6;
}
What is Left and Right Aligning Using the float Property
One method of aligning elements is to use the float property:
How to use Left and Right Aligning Using the float Property
Example
.right {
float: right;
width: 300px;
background-color: #b0e0e6;
}
What is Crossbrowser Compatibility Issues
When aligning elements like this, it is always a good idea to predefine margin and padding for the <body> element. This is to avoid visual differences in different browsers.
There is a problem with IE8 and earlier when using the float property. If the !DOCTYPE declaration is missing, IE8 and earlier versions will add a 17px margin on the right side. This seems to be space reserved for a scrollbar. Always set the !DOCTYPE declaration when using the float property:
How to use Crossbrowser Compatibility Issues
Example
body {
margin: 0;
padding: 0;
}
.right {
float: right;
width: 300px;
background-color: #b0e0e6;
}
All Rights Reserved with Project code