TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
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.
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.