Jump to content

Recommended Posts

create a class such as

.textCenter {text-align: center;}

then wrap the <p> in a <div> and give the div that class.

<div class="textCenter"><p>Hello</p></div>

Now with that all you have done is centered the <p> inside the <div>, not the document so now we need to center the div.

.divCenter {margin: 0 auto;}

Now apply it to the div.

<div class="divCenter textCenter"><p>Hello</p></div>

All done. Now it may seem like allot, but once you add allot more content you will see how convenient this is.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...