Shoutbox

centering <div> tags - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: centering <div> tags (/showthread.php?tid=59725)

centering <div> tags by DJKAL on 05-24-2006 at 11:41 PM

hi, i need another bit of hjelp with the website im working on.
i have a links menu which is set to display the links using the <li> tags "inline" and the .div tag is set to be 750px with borders etc etc and that is all ok. but my question is how can i center this? i want to keep the text alignede to the left as i have it now but want the overall "box" to be in the middle of my page.
i tried using the <center></center> tags around it but that centered my text also so wwas not what i wanted. can anyone please help me?

thanks.

EDIT: just found out it does work (is centered) in internet explorer, but how can i get it to work in firefox also?


RE: centering <div> tags by L. Coyote on 05-25-2006 at 01:15 AM

<div align="center">
<div id="your_current_div">blah</div>
</div>


RE: centering <div> tags by DJKAL on 05-25-2006 at 01:37 AM

thanks thats perfect! :D


RE: centering <div> tags by ShawnZ on 05-25-2006 at 01:49 AM

evil evil booneht.

<div style="margin: 0px auto;">
<div id="your_current_div" style="margin: 0px auto;">blah</div>
</div>


RE: centering <div> tags by L. Coyote on 05-25-2006 at 02:04 AM

quote:
Originally posted by ShawnZ
evil evil booneht.

[same stuff I said, but differently]
That's something each person has to figure out by themselves. I won't provide the additional stuff if I don't know how he wants to do it.

I assume he knows how to modify it to his needs.



quote:
Originally posted by ShawnZ
what do you mean how he wants to do it? its the same thing, execpt mine is the "proper" way
It's the same thing, but without margins. Wow!
RE: centering <div> tags by DJKAL on 05-25-2006 at 02:06 AM

quote:
Originally posted by booneht
I assume he knows how to modify it to his needs.


yer i do mostly. all i needed was to center my the <div> tags without affectng the text, the code you provided me with worked fine so that's all that matters - thanks a lot :)
RE: centering <div> tags by ShawnZ on 05-25-2006 at 02:09 AM

quote:
Originally posted by booneht
quote:
Originally posted by ShawnZ
evil evil booneht.

[same stuff I said, but differently]
That's something each person has to figure out by themselves. I won't provide the additional stuff if I don't know how he wants to do it.

I assume he knows how to modify it to his needs.

what do you mean how he wants to do it? its the same thing, execpt mine is the "proper" way
RE: centering <div> tags by Eljay on 05-25-2006 at 07:18 AM

quote:
Originally posted by ShawnZ
evil evil booneht.

<div style="margin: 0px auto;">
<div id="your_current_div" style="margin: 0px auto;">blah</div>
</div>

you dont need the px on 0 :P