46 users online (1 members and 45 guests)  


  Results 1 to 8 of 8

Related

  1. Does content matter?    Forum: Affiliate Marketing and Reseller Programs
    Replies: 22
  2. Table Properties    Forum: HTML Forum
    Replies: 10
  3. Picture Properties    Forum: CSS Forum
    Replies: 7
  4. new window properties    Forum: HTML Forum
    Replies: 2
  1. #1
    demon_jr's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2003
    Posts
    3

    Question Does the order of properties in CSS matter?

    Hi everyone,

    When I try the following CSS I get an effect where there is a colored bar accross the width of the screen, when the element contains text:

    .top {
    font-size: medium;
    position: absolute;
    top: 20px;
    left: 0px;
    padding: 3px;
    background-color: #336699;
    color: white;
    width: 100%

    }

    However, in this version of the same CSS, the colored bar only goes as far as the length of the text and the style is not applied:

    .top {
    position: absolute;
    top: 20px;
    left: 0px;
    padding: 3px;
    background-color: #336699;
    color: white;
    width: 100%
    font-size: medium;

    }

    The above is true for both IE6 and Mozilla 1.3a (most recent build).

    The only difference between the 2 style sheets are the placement of the "font-size: medium" line.

    Can anyone help me out with this?

    Thanks!

  2. #2
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    In short yes, it does make a difference.

    Dean or another could probably give you better info.

    Dave
    AHFBWEB Less customers per server, more power for you!

    Business Class Shared Hosting

  3. #3
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Code:
    width: 100%
    your missing an ; sign. The reason the placement makes a difference is that this line 'breaks' itself and the one below it, too.

    So add the missing sign and it should work fine.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  4. #4
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316
    the order doesn't matter, order of execution only comes into play if say you have css code in the head of your document, as well as a css file included. the css in your head tags would have precedence then.

  5. #5
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    "the order doesn't matter,"

    Wrong, try putting your a:hover before a:link and see if it works
    AHFBWEB Less customers per server, more power for you!

    Business Class Shared Hosting

  6. #6
    Android's Avatar

    Status
    Offline
    Join Date
    Oct 2002
    Location
    I AM CANADIAN
    Posts
    440

    Talking

    Originally posted by Dave
    "the order doesn't matter,"

    Wrong, try putting your a:hover before a:link and see if it works
    I might be fussy, but a:hover and a:link are selectors; the original question was about properties.

  7. #7
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    Good call
    AHFBWEB Less customers per server, more power for you!

    Business Class Shared Hosting

  8. #8
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316

    RE

    *sticks tongue out*



Tags for this Thread