Firefox -> rel pos text-align

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

Firefox -> rel pos text-align

Post by seodevhead »

I made a #header div box and placed an <h1> inside this div and I want to relatively position it "semi-outside" the bottom of #header and have it centered. Unfortunately, it works great in IE6 but does not center-align the h1 in firefox. Any idea why it is not center-aligning the h1 in FF? Thanks.

#Header {
width: 583px;
text-align: center;
padding-top: 60px;
height: 40px;
border: 1px solid #000;
}

#Header h1 {
position: relative;
width: 480px;
padding: 5px;
border: 1px solid #000;
text-align: center;
}

Any help would greatly be appreciated! Thanks!
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

Code: Select all

#Header {
width: 583px;
text-align: center;
padding-top: 60px;
height: 40px;
border: 1px solid #000;
}

#Header h1 {
position: relative;
width: 480px;
margin:0 auto;
padding: 5px;
border: 1px solid #000;
text-align: center;
}
Add margin:0 auto; to the h1
Post Reply