久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      jq如何改變css樣式寬度

      在jquery中,可以使用css()方法改變樣式,語法格式為“$("元素名稱").css("屬性名","屬性值")”;css()方法設(shè)置或返回被選元素的一個或多個樣式屬性,為所有匹配元素設(shè)置指定CSS屬性。

      jq如何改變css樣式寬度

      本教程操作環(huán)境:windows7系統(tǒng)、jquery1.11.1版、Dell G3電腦。

      css() 方法設(shè)置或返回被選元素的一個或多個樣式屬性。

      返回 CSS 屬性

      如需返回指定的 CSS 屬性的值,請使用如下語法:

      css("propertyname");

      設(shè)置 CSS 屬性

      如需設(shè)置指定的 CSS 屬性,請使用如下語法:

      css("propertyname","value");

      設(shè)置多個 CSS 屬性

      如需設(shè)置多個 CSS 屬性,請使用如下語法:

      css({"propertyname":"value","propertyname":"value",...});

      實例

      <!DOCTYPE html> <html> <head> <script src="/jquery/jquery-1.11.1.min.js"></script> <script> $(document).ready(function(){   $("button").click(function(){     $("p").css({"width":"200px"});   }); }); </script> </head>  <body> <h2>這是標(biāo)題</h2> <p style="background-color:#ff0000">這是一個段落。</p> <p style="background-color:#00ff00">這是一個段落。</p> <p style="background-color:#0000ff">這是一個段落。</p> <p>這是一個段落。</p> <button>為 p 元素設(shè)置多個樣式</button> </body> </html>

      效果:

      jq如何改變css樣式寬度

      【推薦學(xué)習(xí):javascript高級教程】

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號