October 30, 200817 yr Is there any way to center content in IE besides using this code: body { text-align:center; }
November 2, 200817 yr Anyone? Maybe this: <div style="width:600px; margin:0 auto;"> Content in the middle here </div> Is that what you mean? Little James
November 2, 200817 yr Maybe this: <div style="width:600px; margin:0 auto;"> Content in the middle here </div> Is that what you mean? Ahhh inline styling evil evil.... Have you looked at the tutorial that I have written? http://www.webdesignerforum.co.uk/index.php?showtopic=2473 and why don't you want to use text-align:center? whats wrong with it?
November 2, 200817 yr What is the problem you're having exactly? If it is a specific problem it may be worth explaining. Ppl may be more able to post some help then?? i have been doing a lot of reading recently about padding, margins and negative margins which have helped a lot with alignment for me. All the best
November 2, 200817 yr Which version of IE are you talking about? IE6 and above can be centred using e.g. width:800px; margin:0 auto; - but you must use a strict doctype to force standards mode.
November 2, 200817 yr To center content you can use two ways: body { margin-left:auto; margin-right:auto; } or body { margin: 0 auto; } ...this would be the same for every browser. It's true this won't work unless you have a valid doctype declaration, etc. Search Google for "XHTML tutorial" .
November 17, 200817 yr Author Sorry, I forgot about this topic. Maybe this: <div style="width:600px; margin:0 auto;"> Content in the middle here </div> Is that what you mean? Little James Thanks little james! Ahhh inline styling evil evil.... Have you looked at the tutorial that I have written? http://www.webdesignerforum.co.uk/index.php?showtopic=2473 and why don't you want to use text-align:center? whats wrong with it? Yup, I'm strongly against inline styling. All my websites are coded XHTML 1.0 Strict if I can help it. What is the problem you're having exactly? If it is a specific problem it may be worth explaining. Ppl may be more able to post some help then?? i have been doing a lot of reading recently about padding, margins and negative margins which have helped a lot with alignment for me. All the best Yup. Actually All I really wanted to know was if there was any other way. I'm cool with just text-align though. Which version of IE are you talking about? IE6 and above can be centred using e.g. width:800px; margin:0 auto; - but you must use a strict doctype to force standards mode. IE6, IE7. To center content you can use two ways: body { margin-left:auto; margin-right:auto; } or body { margin: 0 auto; } ...this would be the same for every browser. It's true this won't work unless you have a valid doctype declaration, etc. Search Google for "XHTML tutorial" . Thanks for the information.
November 18, 200817 yr /* centre content - cross browser compatible */ body { text-align: center; } #container { margin: 0 auto; width: 930px; } This way you can place all your content inside a container with <div id="container"> and it has the added bonus that it will fit perfectly inside a 1024 browser window. See this website, this one uses that exact method: www.switchfinance.co.uk
Create an account or sign in to comment