SitePoint Sponsor

User Tag List

Results 1 to 16 of 16

Thread: Frustrated!

  1. #1
    Your sister is hott! Sla's Avatar
    Join Date
    Dec 2002
    Location
    The Internet
    Posts
    241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry Frustrated!

    What the heck is wrong with this?

    Code:
    div.left {position:absolute; top:0; left:0; height: 623; width:200; z-index:1; overflow:auto; background-color: #CCCCCC; color:#000000; align:left}
    ???

    W3Schools says that the CSS code for setting the bgcolor is "backgroud-color:" :/

  2. #2
    American't awestmoreland's Avatar
    Join Date
    Sep 2002
    Location
    Grand Rapids, MI
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Works fine for me, but then you don't actually say what's wrong
    From the English nation to a US location.

  3. #3
    Your sister is hott! Sla's Avatar
    Join Date
    Dec 2002
    Location
    The Internet
    Posts
    241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Erg, sorry

    The background of the layer shows up as white...not gray...

  4. #4
    SitePoint Addict
    Join Date
    Sep 2003
    Location
    Europe
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you put any content in there?

  5. #5
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And it might help if we could see the whole thing, rather than just one line of the CSS

  6. #6
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,276
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    Am I looking at the same line as everyone else as the mistakes are obvious

    div.left {position:absolute; top:0; left:0; height: 623; width:200; z-index:1; overflow:auto; background-color: #CCCCCC; color:#000000; align:left}


    What's wrong with this ?

    1) height:623
    623 what %,em,px,pt,ex,cm ????
    You must specify a unit of measurement (except for zero)

    2) width:200
    200 what - see above

    3) align:left
    Not valid CSS! Should be text-align:left.

    The easiset way to see if you are making errors in your css is to run it through the w3c css validator. This can save you hours of time.

    Hope this helps.

    Paul

  7. #7
    American't awestmoreland's Avatar
    Join Date
    Sep 2002
    Location
    Grand Rapids, MI
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Paul O'B
    the mistakes are obvious [img]images/smilies/wink.gif[/img]
    You must specify a unit of measurement (except for zero)
    I noticed that, but I thought that it defaulted to px if you didn't specify?

    <goad>The original code worked as was in a decent browser such as IE6 anyway </goad>


    Andy
    From the English nation to a US location.

  8. #8
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,276
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    Yes IE gets it wrong again and guesses that you meant pixels. If only it would do as it was told life would be much easier

    Mozilla will display it as zero

    Paul

  9. #9
    Your sister is hott! Sla's Avatar
    Join Date
    Dec 2002
    Location
    The Internet
    Posts
    241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here it is -
    Code:
    <style type='text/css'>
    a {color:blue}
    div.left {position:absolute; top:0; left:0; height: 623px; width:200px; z-index:1; overflow:auto; background: #CCCCCC; color:#000000; text-align:left}
    div.center {align:center}
    div.right {align:right}
    </style>
    Here is where it gets implemented
    Code:
    <div id='left'>
    BTW, I think I have Sketch-itus...I can't find my edit button!
    Last edited by Sla; Sep 11, 2003 at 05:34.

  10. #10
    American't awestmoreland's Avatar
    Join Date
    Sep 2002
    Location
    Grand Rapids, MI
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Paul O'B
    Yes IE gets it wrong again ... Mozilla will display it as zero [img]images/smilies/smile.gif[/img]
    Yes, because if you're going to make an assumption about what "600" means, then you can pretty much guarantee that someone meant "0 pixels" rather than "600 pixels"
    From the English nation to a US location.

  11. #11
    SitePoint Zealot Tygger2512's Avatar
    Join Date
    Jul 2003
    Location
    Pittsburg, KS
    Posts
    191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sla
    Here it is -
    Code:
    <style type='text/css'>
    div.left {position:absolute; top:0; left:0; height: 623px; 
    width:200px; z-index:1; overflow:auto; background: #CCCCCC;color:#000000; </style>
    Here is where it gets implemented
    Code:
    <div id='left'>
    You are defining the CSS Rule as a class (div.left)

    and then using id in your code. If you want your div.left to be applied, you need:

    Code:
    <div class="left">
    Note also that the class name needs to be enclosed in double quotes.

    Andy.

  12. #12
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,276
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Also you have made the same mistake again.

    div.center {align:center}
    div.right {align:right}
    There is no CSS align:center or align:right

    You are confusing it with the html align:center.

    It should be text-align:center etc

    Yes, because if you're going to make an assumption about what "600" means, then you can pretty much guarantee that someone meant "0 pixels" rather than "600 pixels"
    CSS is about fluid design therefore those that know what they are doing probably use pixels less than em's or % so why should the browser guess that you meant pixels.

    There be a 600 charge for that bit of information. (is that $, or bananas .

    Paul

  13. #13
    American't awestmoreland's Avatar
    Join Date
    Sep 2002
    Location
    Grand Rapids, MI
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Paul O'B
    CSS is about fluid design therefore those that know what they are doing probably use pixels less than em's or % so why should the browser guess that you meant pixels.
    OK, maybe pixels isn't the right units to assume, but it assumes you mean zero when you clearly mean 600 somethings so why not assume a unit of measurement while it's at it?

    Yes, we have no bananas,

    Andy
    From the English nation to a US location.

  14. #14
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,276
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by Andy
    so why not assume a unit of measurement while it's at it?
    Yes great! And then it could guess what colour I wanted and maybe it could guess that I want a three column layout of equalising columns.

    I think you're onto something there ! We could just enter the first line of the html and let the browser guess the rest of the page. It would save a lot of time .

    (I'm joking by the way - I get your point and can see both sides of the argument but I was looking forward to those bananas.)

    Paul

  15. #15
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by awestmoreland
    OK, maybe pixels isn't the right units to assume, but it assumes you mean zero when you clearly mean 600 somethings so why not assume a unit of measurement while it's at it?

    Yes, we have no bananas,

    Andy
    That's because zero is zero, no matter what unit of measure it is. It's still nothing. When the number is less than or greater than zero, you have to give it context with a unit of measure.

  16. #16
    Your sister is hott! Sla's Avatar
    Join Date
    Dec 2002
    Location
    The Internet
    Posts
    241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Arg...my brain is still mush from the summer.

    Thanks guys


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
  •