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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Sep 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    New to CSS--please check this out and tell me where I'm wrong :)

    I've been reading a little about CSS for the last day or two and I'm finally trying to get going but there is something here snagging me:


    You can obviously see the differences there, what's doing that and how do I fix it? Firebird is displaying it how I want, but IE seems to be doing something else...

    This is the page for you to investigate:
    http://cumrusky.dreyermachine.com/new

    It's probably something really noobish but thanks for taking the time to help me.

  • #2
    Senior Coder
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    2,469
    Thanks
    0
    Thanked 0 Times in 0 Posts
    margin: 0 auto; does not fly for IE (one of many reasons why we dislike this browser), you may try:
    http://bluerobot.com/web/css/center2.html

    But if you still want to get IE to play with the margin auto correctly (IE 6 that is), you can do this:
    http://bluerobot.com/web/css/center1.html

    The only difference from that last one and yours is this:
    Code:
    body {
            text-align:center;
            }
    But that will inherit, so remember that all the other text you pop in there, make sure you give it a new text-align property.
    // Art is what you can get away with. <-- Andy Warhol
    ...:.:::: bradyjfrey.com : htmldog : ::::.:...

  • #3
    Senior Coder
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    2,469
    Thanks
    0
    Thanked 0 Times in 0 Posts
    oh, and welcome to the forums!
    // Art is what you can get away with. <-- Andy Warhol
    ...:.:::: bradyjfrey.com : htmldog : ::::.:...

  • #4
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Well. I had a look at it, but I don't know what you're trying to achieve, so I can't really suggest anything.

  • #5
    New to the CF scene
    Join Date
    Sep 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by bradyj
    snip
    Thanks brady, I'll that later. Did you notice how the text is in different positions also? Any reasons you can see for that?

    Quote Originally Posted by hemebond
    Well. I had a look at it, but I don't know what you're trying to achieve, so I can't really suggest anything.
    I just wanted #container to be centered

  • #6
    Senior Coder
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    2,469
    Thanks
    0
    Thanked 0 Times in 0 Posts
    probably because IE handles box models differently -- it puts the padding 'inside' your defined width, not outside like everyone else. You can send stuff to IE and everyone else via CSS by doing:
    Code:
    #box {
    width: 430px;
    padding: 10px 20px 20px 10px;
    }
    html>body #box {
    width: 400px;
    padding: 10px 20px 20px 10px;
    }
    IE won't understand the last value, because it's not that advanced enough to know that all it saying is (in the html document, in the body area, with the id box...). So it'll take the top value, and skip the bottom one -- leaving you with a way to give values to IE and everyone else without causing a problem

    Off topic side note, you can make things easier on yourself by making your CSS shorthand, here's examples:
    Code:
    #container                    
     { background-color: transparent; background-image: url(img/container_bg.jpg); background-repeat: repeat-y; background-position: 0 0;}
    Can be:
    Code:
    #container                    
     { background: transparent url(img/container_bg.jpg) repeat-y 0 0;}
    And you can do the same things for padding and for fonts, I think you got the padding/margin down from what I see
    // Art is what you can get away with. <-- Andy Warhol
    ...:.:::: bradyjfrey.com : htmldog : ::::.:...


  •  

    Posting Permissions

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