Scope of the <link> tag (specifically the scope of CSS style sheets)

I have a suggestion to the way that CSS style sheets are linked in to an
HTML document. Firstly, let me say I am not sure if this list is the
correct place for this suggestion, if not then please let me know. I did
think it was better here than in www-style however since it is in
reference an HTML tag and not specifically the CSS.

My suggestion is that the <link> tag is either modified or a new tag
more specific to linking CSS files introduced that allows CSS styles to
have a defined scope within an HTML document. Maybe this could be an
extension to the <style> tag, it always seemed slightly unusual that
while you can link an external script file in using <script> that it is
not the <style> tag that is used to reference an external CSS style
sheet (but that is a whole other discussion!).

Consider the following example:

<my document html>
<!-- Start of my menu code -->
<link rel="stylesheet" type="text/CSS" href="menu.css">
  <my menu html>
</link>
<!-- End of my menu code -->
<other document html>

To clarify, the styles contained within the menu.css style sheet would
only be in scope for the portion of html within the <link> tag.

It would be extremely useful, especially in the development of modular
HTML components to be able to use a CSS file for a specific portion of a
webpage and then have the browser forget about the CSS after you close a
tag. It would allow for example, a menu to be displayed in 2 different
colours on the same page while using the same generated HTML. It would
also allow the user to use overloaded standard tag classes much more
freely.

I would be very interested to hear peoples feedback on this.

Best Regards

Dave Verwer
Link HR Systems
mail: d.verwer@link-hrsystems.com


Confidentiality

The information in this e-mail and any attachments to it is/are
confidential and is/are for the addressee only; otherwise the e-mail and
any attached files and copies from them should be destroyed. If you are
not the intended recipient any accessing of the files and any
disclosure, copying, distribution or action on any of the information
contained therein is prohibited and may be unlawful. Link Group
Consultants Ltd. cannot be held liable for any circumstances or losses
that may occur as a result of any attachments included with this
message. Link HR Systems is a trading name of Link Group Consultants
Ltd.

Received on Friday, 4 April 2003 04:43:33 UTC