SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Centering a Horizontal Rule in IE

    Hello,

    I am trying to center an <hr /> tag in Internet Explorer. Simply setting margin: auto works in every other browser, but not IE. I've also tried align: center, which _should_ work, but it did nothing.

    Has anyone else run into this problem?

    Thanks,
    Michael Boutros

  2. #2
    SitePoint Wizard bronze trophy Centauri's Avatar
    Join Date
    May 2007
    Location
    Newcastle, Australia
    Posts
    3,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does the page have a complete and valid doctype ? - without that, you won't get anything to centre with auto side margins in IE.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Centauri,

    The web page is my site, located at http://michaelboutros.com/. As you can see, it does have a valid Doctype declaration, but for some reason it just won't work in IE.

    - Michael Boutros

  4. #4
    SitePoint Wizard bronze trophy Centauri's Avatar
    Join Date
    May 2007
    Location
    Newcastle, Australia
    Posts
    3,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    .long-divider {
    	margin: 0 auto;
    	display: block;
    	width: 68%;
    }

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You sir, are a genius. Thanks so much!


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
  •