Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2011
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts

    CSS Styling issue IE8 Centering a DIV

    Hi all .

    I have an issue with a site I am building at the moment which is causing me some pain. I am able to centre a div perfectly in firefox and Chrome. but for some reason, in good old IE8 its totally skewed and my form ends up one one side of the page and the background for it on the other.

    I think this is additional margin coding issues. but could someone advise best way to fix this please.

    Thanks in advance.

    link is at http://snaplife.co.uk/client/errorlogin.html

    http://snaplife.co.uk/client/errorlogin.html

  • #2
    Regular Coder
    Join Date
    Jul 2011
    Location
    India
    Posts
    496
    Thanks
    3
    Thanked 57 Times in 56 Posts
    Define DOCTYPE and hopefully it will work...

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    Also <style> tags must be in <head> tags only.

    </body> tag is appearing twice...

    validate your site on http://validator.w3.org/ . There are lots of errors.

  • #3
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    look at you html code, line 132. There is nothing in the div. code that you then could use in the div to centre it looks something like this:

    <div id="div1" style="margin-left:auto; margin-right:auto;">

    //content goes here

    </div>

    hope this helps


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •