Dynadot โ€” .com Registration $8.99

Doesn't center in internet explorer

Spaceship Spaceship
Watch
Impact
0
hello there im working on a website. my problem is that it doesnt center in internet explorer. in mozilla firefox it does tho, what can be done. here is the code attached. i have renamed the filenames so i can upload them. the index_css.txt is supposed to be index.css and the index.txt is supposed to be index.html

thank u
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
try putting a center tag between your body tag and container div (and a closing one at the bottom)
 
0
•••
Add
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
To the top of your index.
 
0
•••
Using the center tag is rather dated. The following approach uses CSS.

I don't have time to look at your code unfortunately but this works with all browsers.

Say you want to center the whole website and say there was a container div with class= "container"

Code:
<div class="container">
THE WHOLE SITE HERE
</div>

Then you would put in your css

Code:
div.container{margin: 0 auto}

This thing works and I've used it time and time again to get my stuff to center in all types of browsers. Of course you can modify that code but makes sure that that css code is applied to whatever you are centering.

Hope it works for you.

Skinny
 
0
•••
Skinny, that's what he's using already.
 
0
•••
dated but guaranteed (by me) to work! i do it with my sites, and it all validates anyway. only downside is it could take a good few minutes to apply it to all your pages, but you're very unlikely to every change that property anyway. centering the whole container will always be in style... center tags ftw! ;)
 
0
•••
This is how to do it with CSS.

Code:
body
{
    text-align: center;
}
#container
{
    text-align: left;
    margin: 0 auto;
    text-align: left;
}

Then in your HTML file...

Code:
<body>
    <div id="container">
         <p>Bla</p>
    </div>
</body>

:bingo:
 
0
•••
Appraise.net
Unstoppable Domains
Domain Recover
DomainEasy โ€” Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back