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

    Join Date
    Nov 2012
    Posts
    98
    Rep Power
    2

    Simplest CSS ever


    I've never studied how CSS works (don't ask me why, I never made web-sites after I learned how to a while ago before CSS existed) - I'm trying to make any tag I use the class alert with, red, bold, verdana, and 10px.

    HTML
    Code:
    <p class="alert">Text that is red, bold, 10px, and verdana</p>
    External style sheet
    Code:
    .alert {
    	font:red 10px bold "verdana", verdana, sans-serif;
    }
    The text is not red. Can somebody help me?
    -- Success achieved from tribulation --
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    98
    Rep Power
    2
    Sorry for the horrible question, but I am just looking for a quick fix - i've tried researching the matter but cannot figure it out
    -- Success achieved from tribulation --
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    98
    Rep Power
    2
    hmm #alert worked with different css attribute tags. Got it
    -- Success achieved from tribulation --
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2009
    Location
    Nebraska, USA
    Posts
    829
    Rep Power
    275
    font in css does not have a color property, so,
    Code:
    .alert { font:red 10px bold "verdana", verdana, sans-serif; }
    is invalid.
    check THIS out for proper font css shorthand.

    Code:
    .alert { font:bold 10px verdana, sans-serif;color:red; }
    would get you what you wanted.


    Also, ID's can only be used once, so, your #alert could only be used once, not multiple times.

    Comments on this post

    • Kravvitz agrees
    • BitZoid agrees : Thanks
  8. #5
  9. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    98
    Rep Power
    2
    This is what I needed, thank you!
    -- Success achieved from tribulation --
  10. #6
  11. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,122
    Rep Power
    4258
    Originally Posted by BitZoid
    I've never studied how CSS works (don't ask me why, I never made web-sites after I learned how to a while ago before CSS existed)
    Perhaps you just weren't aware of it, but CSS1 became a W3C Recommendation in 1996.

    The first step in debugging should always be making sure that your code is valid (in order to rule out any errors as the cause for the problem).
    http://validator.w3.org/
    http://jigsaw.w3.org/css-validator/ (Under "more options", make sure the "Profile" is set to "CSS level 3" and set "Vendor Extensions" to "Warnings".)
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  12. #7
  13. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    98
    Rep Power
    2
    Before it became widely accepted than, maybe?

    Originally Posted by Kravvitz
    Perhaps you just weren't aware of it, but CSS1 became a W3C Recommendation in 1996.

    The first step in debugging should always be making sure that your code is valid (in order to rule out any errors as the cause for the problem).
    http://validator.w3.org/
    http://jigsaw.w3.org/css-validator/ (Under "more options", make sure the "Profile" is set to "CSS level 3" and set "Vendor Extensions" to "Warnings".)
    -- Success achieved from tribulation --
  14. #8
  15. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,122
    Rep Power
    4258
    Originally Posted by BitZoid
    Before it became widely accepted than, maybe?
    Deciding on a date that it "became widely accepted" could be difficult. I suppose it would be after IE6 came out in late 2001, but it had been growing gradually before then.
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).

IMN logo majestic logo threadwatch logo seochat tools logo