PDA

View Full Version : CSS align text problem



wickedBoy
June 29th, 2006, 04:40 AM
Very new at this...

I'd like the link list in the middle of the page but don't know the code for centering. Could anyone help me please?

<div id="topBar"></div>
<div id="centerDoc">
<div style="margin-top:25px; margin-bottom:10px; ">
<p><strong>YOU ARE HERE:</strong> <a href="http://www.killersites.com/">HOME</a>
> <a href="../../articles/articlesHome.htm">WEB DESIGN ARTICLES</a> &gt;
CSS TUTORIAL PART 1 </p>
<img src="../../images/BANNER3.gif" width="520" height="101"> </div> Thank you

wB

wickedBoy
June 29th, 2006, 05:20 AM
Got it! Just added


<div align="center"> before and it works like a charm.

wB

simplistik
June 29th, 2006, 09:59 AM
it can be done in css like this too... gonna use inline css since you do (but I never recommend it)


<div id="centerDoc" style="margin: 0 auto">



margin: 0 auto;
is the equivalent of


margin: 0 auto 0 auto;
which is also equal to


margin-top: 0; margin-right: auto; margin-bottom: 0; margin-left: auto;


man I'm feeling extra helpful today...