Use the following steps for give alignment to your web pages
• Step 1
For aligning the text within normal block of paragraph or a block quote then use text-align property.
• Step 2
Left, right and center aligned text
Left, Right, Center, justify are property value of the test-align. Mostly use left, right and center alignment because on the web Justified alignment text is not good for looking,
• Step 3
Normally an element is assigned to an id or class. The text alignment of any items in that id or class is set with a rule such as one of these:
#left {
text-align: left;
}
#right {
text-align: right;
}
#center {
text-align: center;
}
How to Center Divs, Wrapper Divs and Body
• Step 1
For applying the center an entire layout then you has to use a different CSS technique.
• Step 2
For that you have to use CSS rule to the larger element selector you want centered.
• Step 3
Centering by this method does not affect text alignment. The centered element will retain the default left alignment of text within the centered element.
• Step 4
Use following code to use A centered layout
body {
width: 80%;
margin-right: auto;
margin-left: auto;
border: 1px solid black;
}
Bookmarks