• <sub id="h4knl"><ol id="h4knl"></ol></sub>
    <sup id="h4knl"></sup>
      <sub id="h4knl"></sub>

      <sub id="h4knl"><ol id="h4knl"><em id="h4knl"></em></ol></sub><s id="h4knl"></s>
      1. <strong id="h4knl"></strong>

      2. CSS注意事項有哪些

        時間:2024-07-26 10:49:13 CSS 我要投稿
        • 相關推薦

        CSS注意事項有哪些

          在使用CSS應該盡量避免使用哪些技術?下面yjbys小編為大家整理使用CSS的注意事項,希望對大家學習CSS語言有幫助!

          Internet Explorer Behaviors

          它是什么?Internet Explorer 5 引入了行為 (behaviors)。behaviors 是一種通過使用 CSS 向 HTML 元素添加行為的方法。

          為什么要避免它?只有 Internet Explorer 支持 behavior 屬性。

          用什么代替?請使用 JavaScript 和 HTML DOM 取而代之。

          例子 1 - Mouseover Highlight

          下面的 HTML 文件中有一個 <style> 元素,它為 <h1> 元素定義了一個行為:

          <html>

          <head>

          <style type="text/css">

          h1 { behavior: url(behave.htc) }

          </style>

          </head>

          <body>

          <h1>Mouse over me!!!</h1>

          </body>

          </html>

          下面是 XML 文檔 "behave.htc":

          <attach for="element" event="onmouseover" handler="hig_lite" />

          <attach for="element" event="onmouseout" handler="low_lite" />

          <script type="text/javascript">

          function hig_lite()

          {

          element.style.color='red';

          }

          function low_lite()

          {

          element.style.color='blue';

          }

          </script>

          behavior 文件包含了針對元素的 JavaScript 和 事件句柄。

          如果您使用 Internet Explorer,可以親自試一下(把鼠標放在例子中的文本上)。

          例子 2 - Typewriter Simulation

          下面的 HTML 文件中有一個 <style> 元素,它為 id 為 "typing" 的元素定義了一個行為:

          <html>

          <head>

          <style type="text/css">

          #typing

          {

          behavior:url(behave_typing.htc);

          font-family:'courier new';

          }

          </style>

          </head>

          <body>

          <span id="typing" speed="100">IE5 introduced DHTML behaviors.

          Behaviors are a way to add DHTML functionality to HTML elements

          with the ease of CSS.<br /><br />How do behaviors work?<br />

          By using XML we can link behaviors to any element in a web page

          and manipulate that element.</p>

          </span>

          </body>

          </html>

          下面是 XML 文檔 "behave.htc":

          <attach for="window" event="onload" handler="beginTyping" />

          <method name="type" />

          <script type="text/javascript">

          var i,text1,text2,textLength,t;

          function beginTyping()

          {

          i=0;

          text1=element.innerText;

          textLength=text1.length;

          element.innerText="";

          text2="";

          t=window.setInterval(element.id+".type()",speed);

          }

          function type()

          {

          text2=text2+text1.substring(i,i+1);

          element.innerText=text2;

          i=i+1;

          if (i==textLength)

          {

          clearInterval(t);

          }

          }

          </script>

        《&.doc》
        将本文的Word文档下载到电脑,方便收藏和打印
        推荐度:
        点击下载文档

        【CSS注意事項有哪些】相關文章:

        攀巖有哪些注意事項10-22

        登山注意事項有哪些05-10

        瑜伽有哪些注意事項07-19

        跳繩的注意事項有哪些10-04

        健身有哪些注意事項09-13

        染發的注意事項有哪些09-06

        登山有哪些注意事項09-19

        攀巖的注意事項有哪些08-03

        爬山注意事項有哪些06-22

        登山的注意事項有哪些05-28

        在线咨询
        国产高潮无套免费视频_久久九九兔免费精品6_99精品热6080YY久久_国产91久久久久久无码
      3. <sub id="h4knl"><ol id="h4knl"></ol></sub>
        <sup id="h4knl"></sup>
          <sub id="h4knl"></sub>

          <sub id="h4knl"><ol id="h4knl"><em id="h4knl"></em></ol></sub><s id="h4knl"></s>
          1. <strong id="h4knl"></strong>

          2. 色老板精品视频在线观看 | 伊人色综合久久天天人手人婷 | 久久96热情精品国产高清 | 在线国产日韩欧美播放精华一区 | 日韩一级精品久久久久 | 日本按摩高潮A级不卡片 |

            CSS注意事項有哪些

              在使用CSS應該盡量避免使用哪些技術?下面yjbys小編為大家整理使用CSS的注意事項,希望對大家學習CSS語言有幫助!

              Internet Explorer Behaviors

              它是什么?Internet Explorer 5 引入了行為 (behaviors)。behaviors 是一種通過使用 CSS 向 HTML 元素添加行為的方法。

              為什么要避免它?只有 Internet Explorer 支持 behavior 屬性。

              用什么代替?請使用 JavaScript 和 HTML DOM 取而代之。

              例子 1 - Mouseover Highlight

              下面的 HTML 文件中有一個 <style> 元素,它為 <h1> 元素定義了一個行為:

              <html>

              <head>

              <style type="text/css">

              h1 { behavior: url(behave.htc) }

              </style>

              </head>

              <body>

              <h1>Mouse over me!!!</h1>

              </body>

              </html>

              下面是 XML 文檔 "behave.htc":

              <attach for="element" event="onmouseover" handler="hig_lite" />

              <attach for="element" event="onmouseout" handler="low_lite" />

              <script type="text/javascript">

              function hig_lite()

              {

              element.style.color='red';

              }

              function low_lite()

              {

              element.style.color='blue';

              }

              </script>

              behavior 文件包含了針對元素的 JavaScript 和 事件句柄。

              如果您使用 Internet Explorer,可以親自試一下(把鼠標放在例子中的文本上)。

              例子 2 - Typewriter Simulation

              下面的 HTML 文件中有一個 <style> 元素,它為 id 為 "typing" 的元素定義了一個行為:

              <html>

              <head>

              <style type="text/css">

              #typing

              {

              behavior:url(behave_typing.htc);

              font-family:'courier new';

              }

              </style>

              </head>

              <body>

              <span id="typing" speed="100">IE5 introduced DHTML behaviors.

              Behaviors are a way to add DHTML functionality to HTML elements

              with the ease of CSS.<br /><br />How do behaviors work?<br />

              By using XML we can link behaviors to any element in a web page

              and manipulate that element.</p>

              </span>

              </body>

              </html>

              下面是 XML 文檔 "behave.htc":

              <attach for="window" event="onload" handler="beginTyping" />

              <method name="type" />

              <script type="text/javascript">

              var i,text1,text2,textLength,t;

              function beginTyping()

              {

              i=0;

              text1=element.innerText;

              textLength=text1.length;

              element.innerText="";

              text2="";

              t=window.setInterval(element.id+".type()",speed);

              }

              function type()

              {

              text2=text2+text1.substring(i,i+1);

              element.innerText=text2;

              i=i+1;

              if (i==textLength)

              {

              clearInterval(t);

              }

              }

              </script>