THE BORE
General => The Superdeep Borehole => Topic started by: GilloD on August 25, 2008, 03:06:19 PM
-
In Firefox I used margin:auto or margin:0 20 for my content wrapper and those were fine. But I have Googled and attempted every solution to center the content wrapper div in IE7 and no dice. It stays stuck to the left. Thoughts?
-
margin:0 auto 0 auto doesn't work ??? Sometimes it helps to set the body text to center also, I think.
(BTW should I just be using 0 auto alone in my css? I guess the second set might be redundant)
-
html, body {
text-align: center;
}
#cum-wrapper {
margin-left: auto;
margin-right: auto;
}
should work...
-
html, body {
text-align: center;
}
#cum-wrapper {
margin-left: auto;
margin-right: auto;
}
should work...
Awesome. Thanks a ton, again. Like I said- I'm a major n00b when it comes to this and I'm definitley fumbling my way through, so the help is hugely appreciated.
-
if you have text or objects in there, just put
text-align: left; in the wrapper/div object
cause everything will be centered originally - and you should be cool
-
demi is king of CSS tricks.
Do you have a design studio?
-
I found a shortcut to centering something prior to the weekend. I had a 900px wide div I wanted in the center.
.centerDiv
{
width:900px;
position:absolute;
left:50%;
margin-left:-450px;
}
Put the thing dead-on center, too. Thought it was awesome.
Until I unmaximized my browser window, that is. The left side was cutoff the page, couldn't scroll to it or anything. Oh well, live and learn.
So yeah... "text-align:center;" on the outer div, "margin: 0 auto;" and "text-align:left;" on the inner div.
-
I hate working with absolute/relative positioning... never could get it right
-
Does anybody still use tables to form the layout of their webpage? I do.
-
Fortunately, style is not my calling in life. But these div threads did manage to shame me into redoing my own site and getting rid of the tables I was using to control the layout and learn a thing or two about using divs. Wasn't as difficult as I thought it would be once I got the float and clear nonsense down.
-
Does anybody still use tables to form the layout of their webpage? I do.
A lot of "Best Practices..." suggest using like ONE table to align your DIVs.
-
Yeah, I'd still use table(s) to align the div(s), so I don't have to hack CSS tricks all night.
For all the talk of "loose" tags in the transitional DTD of HTML being deprecated or whatever, I doubt any browser is really going to be so anal about standards that it'll refuse to render any and all webpages using <center> for alignment. HTML/XML validation be damned.
So, I have no qualm about using <center>. In my opinion, it's a feature of any browser to support <center>. That shit simplifies everything.
-
Yeah, I'd still use table(s) to align the div(s), so I don't have to hack CSS tricks all night.
For all the talk of "loose" tags in the transitional DTD of HTML being deprecated or whatever, I doubt any browser is really going to be so anal about standards that it'll refuse to render any and all webpages using <center> for alignment. HTML/XML validation be damned.
So, I have no qualm about using <center>. In my opinion, it's a feature of any browser to support <center>. That shit simplifies everything.
Doesn't IE7 already disregard center?
-
I think it's very rare IRL a dev would ever need a <center> tag. Maybe if it valigned center, but why wouldn't you prefer CSS methods of doing that as well? Centering something isn't like bolding something; you're usually centering some specific item like a block or image, in which case you have that CSS hook already.