Results 1 to 4 of 4

Thread: style sheet syntax

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2012
    Posts
    2

    style sheet syntax

    hi all...

    i'm doing a small project that uses a style sheet, and i'm having a problem with the syntax. in the code below, each of the character(s) that are bolded are underlined with a green line, indicating that something is "wrong..." please let me know if anyone see's the error.

    thanking you in advance!!

    jay (freabird)


    <style type="text/css" title="Application Style Sheet">
    <!-
    .pageheading
    {
    color: #000000;
    font-family: Tahoma, Arial;
    font-size: 16PT;
    font-weight: bold;
    }

    .tableheading

    {
    color: #FFFFFF;
    font-family: Tahoma, Arial;
    font-weight: bold;
    font-size: 9pt;
    background-color: #AA0000;
    text-align: center;
    }

    .tabletext

    {
    color: #000000;
    font-family: Tahoma, Arial;
    font-size: 9pt;
    }

    .tabletext_gray

    {
    color: #000000;
    font-family: Tahoma, Arial;
    font-size: 9pt;
    background-color: #CCCCCC;
    }

    ->
    </style>

  2. #2
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: style sheet syntax

    Hi. It would be nice if you could put your CSS code inside [highlight] tags, so it's easier to read on the forums

    [highlight=CSS].test {
    display:none;
    }[/highlight]

    which displays as:

    CSS Code:
    1. .test {
    2.     display:none;
    3. }

    To answer your question:

    I don't think you need/want the title attribute on the <style> tag. The title tag here is used to define alternative style sheet sets, which I don't think you're using.

    Adding HTML comments inside the <style> tag is no longer considered necessary (imho), since you're not likely to come across a browser that doesn't support CSS. If you are going to add them in, then you would want to get the syntax correct. That's why it's complaining about those lines.

    In future, you can use a tool like CSS Lint to validate your CSS (not that the actual CSS here has any problems)
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  3. #3
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: style sheet syntax

    Just for the heck of it i would go on and say that comments in asp.net need two lines.
    So it's <!-- -->
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  4. #4

    Thread Starter
    New Member
    Join Date
    Jun 2012
    Posts
    2

    Re: style sheet syntax

    thanks a lot!!


    Quote Originally Posted by tr333 View Post
    Hi. It would be nice if you could put your CSS code inside [highlight] tags, so it's easier to read on the forums

    [highlight=CSS].test {
    display:none;
    }[/highlight]

    which displays as:

    CSS Code:
    1. .test {
    2.     display:none;
    3. }

    To answer your question:

    I don't think you need/want the title attribute on the <style> tag. The title tag here is used to define alternative style sheet sets, which I don't think you're using.

    Adding HTML comments inside the <style> tag is no longer considered necessary (imho), since you're not likely to come across a browser that doesn't support CSS. If you are going to add them in, then you would want to get the syntax correct. That's why it's complaining about those lines.

    In future, you can use a tool like CSS Lint to validate your CSS (not that the actual CSS here has any problems)

Posting Permissions

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



Click Here to Expand Forum to Full Width