Previous Message
Next Message

overriding CSS?

Sent by Keith Burgin on 2 September 2004 21:09


> I am using a style sheet (CSS) for my site and am pleased with the
> effect however on certain pages I wish to use the default <h1>, <h2>,
> etc.. header styles and wonder if there is some way I can over-ride
> the CSS? Ideally I would not have to alter my .css and would be able
> to just edit the .html files that I wish changed.


Zachary -

another way to do it if you just want to edit your html file, is to give 
your body an ID like <body id="different"> in your external stylesheet.

only use that id for declaring styles that you want to be able to 
disable later.  IE:

#different h1{
	color: #CC0000;
	font-weight: normal;
	font-size: 120%;
	}

#different a {
	color: #996600;
	text-decoration: none;
	}

Then when you want these styles to revert to default, simply remove 
id="different" from the body tag.  As long as you have not declared any 
of these elements broadly like this anywhere else in your CSS, they 
should now be default.

This method only requires that you change one tag in the html rather 
than pasting styles, etc. all over the place.


Good luck.

Keith Burgin
www.burgindesign.com

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: