home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / source_code / dhtmlunl / dhtml.exe / CD Content / Chap15 / dun15_13.txt < prev    next >
Encoding:
Text File  |  1997-12-18  |  1.7 KB  |  68 lines

  1. <HTML>
  2. <HEAD>
  3.   <TITLE>Manipulating Style Sheets in IE4</TITLE>
  4.  
  5.   <LINK ID=linked REL=STYLESHEET TYPE="text/css" HREF="linkedStyle.css">
  6.  
  7.   <STYLE ID=defined TITLE="The Defined Style Sheet">
  8.     H1               { color: darkBlue; margin: 0px; font-size: 18pt; }
  9.     .layer           { position: absolute; }
  10.     #banner          { background-color: yellow; }
  11.   </STYLE>
  12. </HEAD>
  13.  
  14. <BODY>
  15.   <BLOCKQUOTE>
  16.  
  17.   <P><IMG ID=arrow SRC="arrow.gif">
  18.  
  19.   <DIV ID=banner CLASS=layer STYLE="color: blue; left: 72; top: 15;">
  20.     <H1>
  21.       Manipulating Style Sheets in IE4
  22.     </H1>
  23.   </DIV>
  24.  
  25.   <BR><BR>
  26.   Style sheets in IE 4 can be manipulated by adding new rules
  27.   to specific style sheets, importing new style sheets and disabling
  28.   existing style sheets.  Click on the links below to manipulate the
  29.   style sheets attached to this document.</P>
  30.  
  31.   <P ALIGN=center>
  32.   <A HREF="" onClick="attachImport(); return false;">
  33.     Import the style sheet <TT>importStyle.css</TT>
  34.   </A></P>
  35.  
  36.   <P ALIGN=center>
  37.   <A HREF="" onClick="disableLinked(); return false;">
  38.     Disabled the style sheet <TT>linked</TT>
  39.   </A></P>
  40.  
  41.   <P ALIGN=center>
  42.   <A HREF="" onClick="addRule(); return false;">
  43.     Add the rule<BR>
  44.     <TT>BODY { font-weight: 900 }</TT><BR>
  45.     to the defined style sheet
  46.   </A></P>
  47.  
  48.   <SCRIPT>
  49.     function attachImport()
  50.     {
  51.       document.styleSheets.defined.addImport("importedStyle.css");
  52.     }
  53.  
  54.     function disableLinked()
  55.     {
  56.       document.styleSheets.linked.disabled = true;
  57.     }
  58.  
  59.     function addRule()
  60.     {
  61.       document.styleSheets.defined.addRule("BODY", "font-weight: 900");
  62.     }
  63.   </SCRIPT>
  64.  
  65.   </BLOCKQUOTE>
  66. </BODY>
  67. </HTML>
  68.