CSS: How to center an entity on an html page without using “text-align:center”

Trying to align content on an html page can be frustrating for those new to writing html. Css helps to simplify this process but getting to know the rules of the language takes time. One quick tip that can improve the look of content within your page is using auto margins. This can be done by using css:

auto margins

Make the margin-right and margin-left equal to the value: auto. The element above in the screen shot has a width of 1000px will essentially float in the enter of the page, regardless of how large/small the user forms their browser. Make sure you do not include float:left or float:right, as this will override your auto margins.

Casey Bradford

~ by caseybradfo on October 25, 2011.

One Response to “CSS: How to center an entity on an html page without using “text-align:center””

  1. I have chosen this as my blog post that needs the most work. The picture is difficult to read, and it could use some examples. Some things that this issue could fix or how this technique could be applied

Comments are closed.

%d bloggers like this: