Re: Putting HTML comments in CSS style definitions?

Subject: Re: Putting HTML comments in CSS style definitions?
From: Tom Murrell <trmurrell -at- yahoo -dot- com>
To: "TECHWR-L" <techwr-l -at- lists -dot- raycomm -dot- com>
Date: Tue, 6 Mar 2001 04:57:57 -0800 (PST)

--- Rowena Hart <rowena -at- vocalscape -dot- com> wrote:
>
[SNIP]
> Is it okay/advisable to use HTML comments in your
> CSS style definitions? I'm using a pre-defined
> set of CSS styles created by a contractor, but
> I'm finding it difficult to understand when to
> use styles with similar properties. As you can
> imagine, this problem is compounded if more than
> one person is applying the CSS styles and the
> style usage is ambiguous.
>
> For example, it would be nice to have a comment
> explaining when to use the style "bodysmall" in
> an online document. Embedding a hidden comment
> in the style definition (as shown) seems like a
> good idea:
>
> .bodysmall
> {
> COLOR: Black;
> FONT-FAMILY: Verdana, arial, helvetica, sans-serif;
> FONT-SIZE: 10px;
> LINE-HEIGHT: 24px;
> TEXT-ALIGN: left;
> TEXT-DECORATION: none
> }
> <!-- Use .bodysmall for the body text in
> captions. -->
>
> Is this legal in a CSS style definition? If
> not, is there any other way to embed a comment
> in a CSS style definition?

It's unclear to me whether you are using a <STYLE> section in your HTML
document or a Cascading Style Sheet. It sounds like you should be using the
latter if, as it appears, you are reusing the same styles across a collection
of documents.

I see nothing wrong with using HTML style comments if the style section is in
the HTML document. However, I would not use that style of comment in a
stylesheet. CSS defines comments for stylesheets in this manner:

/* Your Comments Here */

You can put those comments anywhere in the stylesheet, even with a line of code
to describe what that line is for.

If I were doing what you described, I think I would put the comment before the
style rather than after it.

It sounds like you might be better served with a style guide that explained
when to use what class of component in which situation and have writers work
from the style guide rather than reading the stylesheet each time.

=====
Tom Murrell
Lead Technical Writer
Alliance Data Systems
Columbus, Ohio
mailto:trmurrell -at- yahoo -dot- com
Personal Web Page - http://home.columbus.rr.com/murrell/

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Develop HTML-Based Help with Macromedia Dreamweaver 4 ($100 STC Discount)
**New Dates!!** San Francisco (Apr 16-17), San Jose (Mar 29-30)
http://www.weisner.com/training/dreamweaver_help.htm or 800-646-9989.

IPCC 01, the IEEE International Professional Communication Conference,
October 24-27, 2001 at historic La Fonda in Santa Fe, New Mexico, USA.
CALL FOR PAPERS OPEN UNTIL MARCH 15. http://ieeepcs.org/2001/

---
You are currently subscribed to techwr-l as: archive -at- raycomm -dot- com
To unsubscribe send a blank email to leave-techwr-l-obscured -at- lists -dot- raycomm -dot- com
Send administrative questions to ejray -at- raycomm -dot- com -dot- Visit
http://www.raycomm.com/techwhirl/ for more resources and info.


Previous by Author: Re: Ruffled Feathers
Next by Author: Re: Why I need the Internet at Work (spun off Fave Tech Writing websites)
Previous by Thread: Re: Putting HTML comments in CSS style definitions?
Next by Thread: Learning Visual Basic - Books for beginners


What this post helpful? Share it with friends and colleagues:


Sponsored Ads