<link href="style.css" rel="stylesheet">
<link href="default.css" rel="stylesheet" title="Default Style">
<link href="fancy.css" rel="alternate stylesheet" title="Fancy">
Head Section
<meta http-equiv="default-style" content="preferred">
<style title="preferred">
p {
background-color:black;
color:white;
}
</style>
<link rel="stylesheet" href="./expt.css" title="default">
External Stylesheet
p {color: green;}
Body
<p>Earth</p>
Output
Notes
- The internal stylesheet, although appearing before the external stylesheet,
takes precedence as it is the
default-style
("preferred")
- The external stylsheet is completly disabled
- For this tecnique to work, both stylesheets must have a
title
attribute,
otherwise the stylesheet is persistent (see entry for
link)
Head
<style>
#myid {
background-color:black;
color:white;
}
</style>
Body
<p id="myid" style="color:red;background-color:blue">Earth</p>
Output
Notes
- Note that inline
style=
overrides id