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 4 of 4
  1. #1
    New Coder
    Join Date
    Feb 2012
    Posts
    14
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Simple question about alignment...

    Hi guys,

    <style>
    #nav.menu {
    float: right;
    text-align: right;
    background-color: #EFF9FC;
    }
    </style>

    <div id="nav" class="menu">
    <a href="A.html">Do A</a>&nbsp;
    <a href="B.html">Do B</a> <br/>
    </div>

    It works as expected, that is, the two items float to the right of the screen, for Firefox 10 but not IE9, what's wrong?

    Thanks.

  • #2
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,233
    Thanks
    10
    Thanked 270 Times in 269 Posts
    You're missing a ton of other html to make that a complete page. I realize you may have done it to focus our attention on the specifics, but do you have a doctype, for example - that's always key for IE. Secondly does the page validate?

    Dave

  • Users who have thanked tracknut for this post:

    knowledgenotebk (03-13-2012)

  • #3
    New Coder
    Join Date
    Feb 2012
    Posts
    14
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Good thought.

    The page is a part of a web app...
    1. At top level,
    <html xmlns="http://www.w3.org/1999/xhtml">

    2. At this page level, I added the following,
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    to no avail.

    I haven't replaced 1. with 2.
    would rather not to touched it...

    A workaround is to detect browser and add the nowrap attribute for IE for a TD element.

    Thanks.

  • #4
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    I think what Dave is trying to tell you, is post your complete html and css using the # button. Even better would be a link to your live test site.
    Teed


  •  

    Posting Permissions

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