SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Addict
    Join Date
    Mar 2010
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Centering a div...in IE6

    Hi everyone...

    Please help me. Paul helped me so far with my site... I need to place a .png (in a div called .underline) file centered under the .intro div on this page. I am able to do this in all the browsers but in IE6 in shifts to the left.... I am not sure what happens here...can you help me please?

    http://www.rajeevthomas.com/

  2. #2
    SitePoint Zealot Gar onn's Avatar
    Join Date
    Feb 2011
    Location
    Belgium
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Euhm, why support IE6?
    only 3.9% of all internet users use IE6 as browser...

    (I would just advice an update or an other browser)

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,871
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Are you sure that absolutely nothing precedes the doctype tag in the source of the page. Even a space or byte order mark will throw IE6 into quirks mode.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #4
    SitePoint Addict
    Join Date
    Mar 2010
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    felgall I do not know much about CSS .....am I supposed to place anything after the doctype tag? where do I find this info?

    Garon I have some friends who still uses IE6..........:-) not very cool I know.....

  5. #5
    SitePoint Addict
    Join Date
    Mar 2010
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know, my reply was stupid... I came home and read up on the doctypes and I made sure nothing is before the doctype I am using. But it still does not corrects the problem.

  6. #6
    SitePoint Addict
    Join Date
    Mar 2010
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb

    Hi guys...

    I just read a very informative article --> http://dorward.me.uk/www/centre/ and it said...
    The default width for most block level elements is auto, which fills the available area on screen. Just being centred places it in the same position as left alignment. If you wish it to be visually centred you should set a width (or a max-width although Internet Explorer 6 and earlier do not support this, and IE 7 only supports it in standards mode).
    God!! so much to learn!!! This really helped to solve the problem... Thank you guys...

  7. #7
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,555
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Yes to center block elements you need to give them a width and then using margin:0 auto to center them.

    To center inline elements you would just apply text-align:center on the parent.

    Glad you got it sorted.

  8. #8
    SitePoint Addict
    Join Date
    Mar 2010
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much Paul... I appreciate your help always....


Bookmarks

Posting Permissions

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