   [web] how to center div?
  in html, how do you tell your div to be centered at all resolutions?   
  you have to set the margin like this:<div style="width:[width here]; margin: 0 auto;></div>you can change the 0 to whatever you want. (Not really HTML but CSS is your friend [smile])   ;<div align="center">blahor<div style="position:relative;left:25%;right:25%">blah2;  cool, thanks.   ;Quote:Original post by capn_midnight<div align="center">blah</div>What browser are you using? When I do that in FireFox the div stays left-aligned and the text inside is centered.;Quote:Original post by DigiDudeQuote:Original post by capn_midnight<div align="center">blah</div>What browser are you using? When I do that in FireFox the div stays left-aligned and the text inside is centered.That's what it *should* do. The margin: auto is the correct way to do it, but IIRC Internet Explorer doen't like it (no surprise here...);  well after further use, the div now seems to be aligning itself to the left. using  capn_midnights example. any more help?edit: yeah, it behaves like DigiDude said. i'll try your example digidude.   ;  i got it working, thanks for the help.   ;  Many "Lounge Lizards" don't know there are other forums on GameDev, including the Web Development Forum [wink].  And yes, <div align="center">blah</div> it is.   ;Quote:Original post by Rob LoachAnd yes, <div align="center">blah</div> it is.No no, that centers the content of the div.