Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Senior Member Holokai's Avatar
    Join Date
    Sep 2004
    Location
    Honolulu, HI
    Posts
    127
    Member #
    7707
    if you look here, you'll see one of two things - if you're using FF or mozila, a simple page with a menu that's about 10px from the right border of it's container. if you're using i.e., you'll see that same menu about 30px away. I've tried using
    Code:
    * html #menu{
    margin: 1px -11px;
    }
    and this aligns the box where I want it, but then the text flows under the box for a few pixels. Any suggestions?

    Thanks, Chris
    -----------------------------------------------
    I know just enough to be dangerous to myself and others around me... I'm more of a CSS kamikaze than a CSS ninja...

  2.  

  3. #2
    Member
    Join Date
    Aug 2004
    Location
    Ohio
    Posts
    47
    Member #
    7210
    "* html #menu" isn't any more meaningful than #menu (since #menu is only going to be used once in the page, defining it in relation to a parent element as well is redundant), and it won't do you much good when there isn't even an html tag in the code. Before you can even begin to gauge what is broken, you have to put the html, head, and body tags in. A proper doctype declaration is also likely necessary to get a consistent result across browsers. Otherwise they will likely render in "quirks" mode, except for Opera, which always renders in strict mode from what I've heard.

    good DOCTYPE info:
    http://www.alistapart.com/articles/doctype/

  4. #3
    Senior Member Holokai's Avatar
    Join Date
    Sep 2004
    Location
    Honolulu, HI
    Posts
    127
    Member #
    7707
    Quote Originally Posted by Usurper
    "* html #menu" isn't any more meaningful than #menu (since #menu is only going to be used once in the page, defining it in relation to a parent element as well is redundant),
    * html #menu is a tag that only IE will pick up, isn't it? in this way, I can define a seperate id for Mozilla and IE.
    Quote Originally Posted by Usurper
    and it won't do you much good when there isn't even an html tag in the code. Before you can even begin to gauge what is broken, you have to put the html, head, and body tags in. A proper doctype declaration is also likely necessary to get a consistent result across browsers. Otherwise they will likely render in "quirks" mode, except for Opera, which always renders in strict mode from what I've heard.

    good DOCTYPE info:
    http://www.alistapart.com/articles/doctype/
    Ok, all that is done now. You're right, and thanks for the slap on the wrist. I forget that stuff sometimes.(read: all the time)
    It fixed a few of the problems I had, including the menu, but now I cannot get my main content area to be at the top of the page. there seems to be about 10px of space between it and the top, and nothing I've tried has worked to fix this. Help!

    - Chris
    -----------------------------------------------
    I know just enough to be dangerous to myself and others around me... I'm more of a CSS kamikaze than a CSS ninja...

  5. #4
    Member
    Join Date
    Aug 2004
    Location
    Ohio
    Posts
    47
    Member #
    7210
    * html #menu is a tag that only IE will pick up, isn't it? in this way, I can define a seperate id for Mozilla and IE.
    Might be a quirk. I usually use IE's conditional comments for passing IE-only css info. I've also seen where css2 selectors work in most modern browsers, but not IE, and can be used to pass code unreadable to IE.

    As for your gap, I saved a local copy, and the gap vanished when I added "margin:0px; padding:0px" to the body tag's css. Browsers typically apply a default value for the body element that you have to explicitly override. I didn't test the page with images, so I'm not sure if it lines up perfectly or not.

  6. #5
    Senior Member Holokai's Avatar
    Join Date
    Sep 2004
    Location
    Honolulu, HI
    Posts
    127
    Member #
    7707
    Excellent link, Usurper. Is there a reason to use that over the * html thing? I don't recall the versions that the * html works for, but I think it might work for ie4 and up. I'll go find out.
    -----------------------------------------------
    I know just enough to be dangerous to myself and others around me... I'm more of a CSS kamikaze than a CSS ninja...

  7. #6
    Member
    Join Date
    Aug 2004
    Location
    Ohio
    Posts
    47
    Member #
    7210
    "* html" might not validate since it's referring to a parent element above the html tag, which wouldn't exist to the best of my knowledge. If you want your page to validate as standards-compliant markup, you might have to forgo that technique.

    Also, since other browsers ignore conditional comments (they ARE in comment tags, after all), you wouldn't have to worry about future versions of non-IE browsers changing the way they interpret it.

  8. #7
    Senior Member
    Join Date
    Dec 2003
    Posts
    1,274
    Member #
    4362
    You have to think on the opposite:
    Write css for IE, and then use advanced selectors to apply FF/Mozilla/Opera settings, for example:
    Code:
    #funkyID {
      margin:10px 5px
    }
    html > #funkyID {
      margin:8px 3px /* This will be ignored by IE */
    }

  9. #8
    Senior Member Holokai's Avatar
    Join Date
    Sep 2004
    Location
    Honolulu, HI
    Posts
    127
    Member #
    7707
    Quote Originally Posted by Usurper
    "* html" might not validate since it's referring to a parent element above the html tag, which wouldn't exist to the best of my knowledge. If you want your page to validate as standards-compliant markup, you might have to forgo that technique.

    Also, since other browsers ignore conditional comments (they ARE in comment tags, after all), you wouldn't have to worry about future versions of non-IE browsers changing the way they interpret it.
    Ok, good point. I'll switch up.
    -----------------------------------------------
    I know just enough to be dangerous to myself and others around me... I'm more of a CSS kamikaze than a CSS ninja...

  10. #9
    Senior Member Holokai's Avatar
    Join Date
    Sep 2004
    Location
    Honolulu, HI
    Posts
    127
    Member #
    7707
    Quote Originally Posted by xarst
    You have to think on the opposite:
    Write css for IE, and then use advanced selectors to apply FF/Mozilla/Opera settings, for example:
    Code:
    #funkyID {
      margin:10px 5px
    }
    html > #funkyID {
      margin:8px 3px /* This will be ignored by IE */
    }
    Xarst, I'd rather write CSS the way it should be written then break it for IE lafter wards. I think it just makes good sense, since IE will (hopefuully) eventually be fully compliant.
    -Chris
    -----------------------------------------------
    I know just enough to be dangerous to myself and others around me... I'm more of a CSS kamikaze than a CSS ninja...


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:16 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com