CSS inheritance
If you apply a unique id to <body>
your custom page , you can easily make that page specific ads in your global css. There is no point in serving another css file as your global / site css will be cached on the client anyway.
Personally, I think it's good practice to manage page specific styles. In php, you can achieve this dynamically in your view with
<body id="<?= basename($_SERVER['PHP_SELF'], ".php")?>">
in ASP.Net you can set the id using:
System.IO.Path.GetFileNameWithoutExtension(HttpContext.Current.Request.Url.AbsolutePath).ToLower
a source to share
You can use JavaScript to remove the associated CSS file, but then you only need to add that JavaScript on this page.
Alternatively, you can put the id in the body tag and set a completely different set of CSS rules for that page:
Standard Pages:
<body id="standard">
#standard h1 {
color:blue;
}
Another page:
<body id="different">
#different h1 {
color:red;
}
A little planning ahead is worth the effort
a source to share
actually. there are ways to remove the css (eg: http://www.javascriptkit.com/javatutors/loadjavascriptcss2.shtml ) but it doesn't work in IE
Under what circumstances do you want to do this? Don't have control over the page?
a source to share