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.  
  3. <HEAD>
  4.  
  5.   <TITLE>Manipulating Style Sheets in IE4</TITLE>
  6.  
  7.  
  8.  
  9.   <LINK ID=linked REL=STYLESHEET TYPE="text/css" HREF="linkedStyle.css">
  10.  
  11.  
  12.  
  13.   <STYLE ID=defined TITLE="The Defined Style Sheet">
  14.  
  15.     H1               { color: darkBlue; margin: 0px; font-size: 18pt; }
  16.  
  17.     .layer           { position: absolute; }
  18.  
  19.     #banner          { background-color: yellow; }
  20.  
  21.   </STYLE>
  22.  
  23. </HEAD>
  24.  
  25.  
  26.  
  27. <BODY>
  28.  
  29.   <BLOCKQUOTE>
  30.  
  31.  
  32.  
  33.   <P><IMG ID=arrow SRC="arrow.gif">
  34.  
  35.  
  36.  
  37.   <DIV ID=banner CLASS=layer STYLE="color: blue; left: 72; top: 15;">
  38.  
  39.     <H1>
  40.  
  41.       Manipulating Style Sheets in IE4
  42.  
  43.     </H1>
  44.  
  45.   </DIV>
  46.  
  47.  
  48.  
  49.   <BR><BR>
  50.  
  51.   Style sheets in IE 4 can be manipulated by adding new rules
  52.  
  53.   to specific style sheets, importing new style sheets and disabling
  54.  
  55.   existing style sheets.  Click on the links below to manipulate the
  56.  
  57.   style sheets attached to this document.</P>
  58.  
  59.  
  60.  
  61.   <P ALIGN=center>
  62.  
  63.   <A HREF="" onClick="attachImport(); return false;">
  64.  
  65.     Import the style sheet <TT>importStyle.css</TT>
  66.  
  67.   </A></P>
  68.  
  69.  
  70.  
  71.   <P ALIGN=center>
  72.  
  73.   <A HREF="" onClick="disableLinked(); return false;">
  74.  
  75.     Disabled the style sheet <TT>linked</TT>
  76.  
  77.   </A></P>
  78.  
  79.  
  80.  
  81.   <P ALIGN=center>
  82.  
  83.   <A HREF="" onClick="addRule(); return false;">
  84.  
  85.     Add the rule<BR>
  86.  
  87.     <TT>BODY { font-weight: 900 }</TT><BR>
  88.  
  89.     to the defined style sheet
  90.  
  91.   </A></P>
  92.  
  93.  
  94.  
  95.   <SCRIPT>
  96.  
  97.     function attachImport()
  98.  
  99.     {
  100.  
  101.       document.styleSheets.defined.addImport("importedStyle.css");
  102.  
  103.     }
  104.  
  105.  
  106.  
  107.     function disableLinked()
  108.  
  109.     {
  110.  
  111.       document.styleSheets.linked.disabled = true;
  112.  
  113.     }
  114.  
  115.  
  116.  
  117.     function addRule()
  118.  
  119.     {
  120.  
  121.       document.styleSheets.defined.addRule("BODY", "font-weight: 900");
  122.  
  123.     }
  124.  
  125.   </SCRIPT>
  126.  
  127.  
  128.  
  129.   </BLOCKQUOTE>
  130.  
  131. </BODY>
  132.  
  133. </HTML>
  134.  
  135.