中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

jQuery css() 方法


jQuery css() 方法

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


返回 CSS 屬性

如需返回指定的 CSS 屬性的值,請(qǐng)使用如下語(yǔ)法:

css("propertyname");

下面的例子將返回首個(gè)匹配元素的 background-color 值:

實(shí)例

$("p").css("background-color");

運(yùn)行代碼 ?

設(shè)置 CSS 屬性

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

css("propertyname","value");

下面的例子將為所有匹配元素設(shè)置 background-color 值:

實(shí)例

$("p").css("background-color","yellow");

運(yùn)行代碼 ?

設(shè)置多個(gè) CSS 屬性

如需設(shè)置多個(gè) CSS 屬性,請(qǐng)使用如下語(yǔ)法:

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

下面的例子將為所有匹配元素設(shè)置 background-color 和 font-size:

實(shí)例

$("p").css({"background-color":"yellow","font-size":"200%"});

運(yùn)行代碼 ?