954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

CSS rules

Ok i have written a CSS code for body

body
{
	margin: 0 auto;
}

#header
{
	font-family: Georgia,Times,serif;
}


With the CSS code for body everything that's inside the body should be placed in the center of the page because the body is in the center.

In html i have written a paragraph with p tag and an id of header inside the body but the problem is that the paragraph instead of appearing in the center appears at the left most side of the page.

What's the problem shouldn't the P tag appear in center as it is inside the body ?

rrr12345
Newbie Poster
11 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

You haven't given the body a width less than 100% - therefore your body is 100% wide and the p is exactly where it belongs - on the left side of the body. If you want every thing inside the body centered that's

text-align:center;
Dandello
Posting Whiz in Training
263 posts since May 2010
Reputation Points: 28
Solved Threads: 23
 

You haven't given the body a width less than 100% - therefore your body is 100% wide and the p is exactly where it belongs - on the left side of the body. If you want every thing inside the body centered that's

text-align:center;


Thank you now i exactly understand the problem.

rrr12345
Newbie Poster
11 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You