Re: Re validating style

by "Abhay S. Kushwaha" <abhay(at)kushwaha.com>

 Date:  Fri, 28 Apr 2000 13:06:53 +0530
 To:  "Basics [HWG]" <hwg-basics(at)hwg.org>
 References:  default
  todo: View Thread, Original
First, as the error says, you omitted a "required" attribute TYPE in
the <STYLE> tag. Whenever you <STYLE>, you *must* use the attribute
TYPE. If you just modify your code

From: <style>
To  : <style type="text/css">

it will solve the problem.

Another thing... you can enclose all the style rules in a single
<style></style> combo. That is, your code would look like this:

<style type="text/css"><!--
  a:hover {color:#ffd700}
  h1 {color:red}
  h2 {color:red}
  h3 {color:red}
  -->
</style>

Then, in styles, you have this thing called "Grouping". It means that
if you have the same rule for multiple elements (that's same as tags
basically) you can 'group' the style rule in one go. So, now, you
could just write the same thing as:

<style type="text/css"><!--
  a:hover {color:#ffd700}
  h1, h2, h3 {color:red}
  -->
</style>

HWG has a FAQ about CSS [1] that you could check out. Take a look at
W3C site on CSS [2] as well. I found some links like the "MSDN Brief
Overview for Designers" [3] and the Jakob Nielsen's "Effective Use of
Style Sheets" [4] there only.

Welcome to the wonderful world of CSS! :)

[abhay]

----
 [1] http://www.hwg.org/resources/faqs/cssFAQ.html
 [2] http://www.w3.org/Style/CSS/
 [3] http://msdn.microsoft.com/workshop/design/layout/css-des.asp
 [4] http://www.useit.com/alertbox/9707a.html


----- Original Message -----
From: BFennessy <berfen(at)eircom.net>
Subject: Re validating style

> I have been trying to validate my pages and am almost there
> except for this. I get the following message
>
>   <style>
>         ^
> Error: required attribute "TYPE" not specified
>
> when trying to validate the following
>
> <style>
> <!--
> a:hover {color:#ffd700}
> -->
> </style>
>
> <style type="text/css">
> <!--
> h1{color:red}
> h2{color:red}
> h3{color:red}
> -->
> </style>
>
> I would appreciate it if anyone could tell me what type should
> be included for the first style and I assume that the second
> type is correct. I don't know a lot about styles and am trying
> this out

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA