0

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 ?

Edited by rrr12345: n/a

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by rrr12345
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;
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;

Thank you now i exactly understand the problem.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.