FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

CSS layout problem

 


Mosquito.Tyler
http://i73.photobucket.com/albums/i202/tylerethomas/desktop.jpg

Please take a look at that picture, and notice how the div is aligned to the left.

This is the CSS I'm using to try to make the div centered.

Code:

body{
background-color:#dddddd;
padding:10px;
text-align:center;
}




And THIS is my full code.

Why is that div not centered?

Thanks in advance Smile
sonam
Code:
p.text:first-letter{font-family:old english text mt; font-size:2.5em; color:#3357A4;float:left}


I am not sure, but p style have definition float:left; and in this situation if is your text between <p> and </p> this style have priority.

Sonam
jeremyw
Your problem is that the text-align property does just that, it only aligns text. Internet Explorer may fool with it and align other things too, but Firefox definitely only aligns text. I found a trick to align other elements in Firefox by using the margin property:
Code:
a{margin:auto}

This should effectively center your image, making the margin fill the rest of the space. Hope this is helpful.
Mosquito.Tyler
Thank you very much Jeremy. That solved many issues I've been having Smile
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.