#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    119
    Rep Power
    12

    some VERY basic questions about CSS syntax


    Hi all,

    What does this mean?

    H1 A:link { color:#fff }

    - or -

    .sectionhead H2 { font-size: 12px; }

    I'm asking specifically about the space between the name of the selector and the HTML tag reference. What function does that space have? If it were a comma I would know, but I don't know what a space means. Sorry if totally dumb question.

    Also, I keep seeing three-character hex values (e.g., #fff, #0cd, #078, etc). How are they used, what do they mean? I would have thought it meant to repeat the three characters to make the six (eg, #ffffff, #0cd0cd, #078078) but that appears not to be the case.

    I've been looking around w3schools.org to find answers to questions like these, but no luck. Any suggestions?

    Thanks to anybody who takes the time to answer!

    Laura S.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    119
    Rep Power
    12
    To elaborate my first question further, what does THIS mean?

    TR TD.someNav A:link, TR TD.someNav A:visited { text-decoration: none;}

    Thanks again,
    Laura S.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    3
    Rep Power
    0
    The space allows you to be more specific when matching. For instance:

    a:link {color: #fff;}

    will match on *all* <a> tags

    h1 a:link {color: #fff;}

    will only match on <a> tags that are nested within <h1> tags, such as

    <h1>This is a Title <a href="nowhere.com">This is a Link In a Title</a></h1>

    Here is a useful reference for this sort of thing:

    http://www.htmlhelp.com/reference/css/

    Also, this site is an excellent reference of examples and resources if you haven't checked it out:

    http://www.csszengarden.com

    Good luck,
    ---atomgiant
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    119
    Rep Power
    12
    Thank you, that totally makes sense once I hear it from someone else.

    That leaves my other question about the 3 character color references -- the only two obvious possibilities are:

    1) #123 ==> #123123

    or...

    2) #123 ==> #112233

    but neither of these seems to be the case. I've tested both cases and in neither case is the six digit code equivalent to the 3 digit code.

    Please help because I'm sure the answer is trivial and I'm spending too much time on it!!!

    Thanks again.

    Laura S.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    3
    Rep Power
    0
    The second one is correct. Here is a thread I found that discusses it:

    http://www.csscreator.com/css-forum/viewtopic.php?t=295
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    119
    Rep Power
    12
    Ah, right. I was testing this using the html <body> tag and using a bgcolor of "abc" vs "aabbcc" and the colors were completely different! But if I style the background-color of the page using CSS, then the two versions of coding the color are the same.

    Silly me ...

    Thanks for the help.

    Laura S.

IMN logo majestic logo threadwatch logo seochat tools logo