jQuery的css()方法
下面的代码可以为div一次性设置多个样式属性
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>css3</title>
<script src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("#AB").css({
    color:"red",
    fontSize:"16px",
    fontWeight:"bold"
  });
});
</script>
</head>
<body>
<div id="AB">00H5</div>
</body>
</html>
当然也可以单个设置CSS样式如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS</title>
<script src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("#AB").css("color","red");
});
</script>
</head>
<body>
<div id="AB">00H5</div>
</body>
</html>

jQuery的css()方法的更多相关文章

  1. jQuery HTML CSS 方法

    jQuery HTML / CSS 方法 下面的表格列出了所有用于处理 HTML 和 CSS 的 jQuery 方法. 下面的方法适用于 HTML 和 XML 文档.除了:html() 方法. 方法 ...

  2. Jquery中css()方法获取边框长度

    1. JQuery中可以使用css()方法获取块元素的边框宽度,如下: $("divMode").css("border-left-width");//左边框长 ...

  3. jquery之 css()方法。用法类似的有attr(),prop(),val()

    [注]attr(),prop(),val()的用法结构和css()一致,可参考 css()函数用于设置或返回当前jQuery对象所匹配的元素的css样式属性值. 该函数属于jQuery对象(实例).如 ...

  4. jQuery通过CSS()方法给指定的元素同时设置多个样式

    <!DOCTYPE html> <html> <head> <script src="http://ajax.googleapis.com/ajax ...

  5. form 表单 和 jQuery HTML / CSS 方法($().html 类似的样式)

    1 有关链接 :http://www.runoob.com/tags/tag-form.html https://www.cnblogs.com/Jxwz/p/4509618.html https:/ ...

  6. jQuery HTML/CSS 方法大全

    下表列出了用于操作HTML和CSS的所有方法. 方法 描述 addClass() 向所选元素添加一个或多个类名 after() 在所选元素之后插入内容 append() 在所选元素的末尾插入内容 ap ...

  7. 使用原生实现jquery中的css方法

    由于jquery放在mobile页面上,有时候还是显得有点大,所以今天尝试使用原生来开发,但是习惯了jquery之后,转用原生开发之后,发现原生中,找不到可以替代jquery的css方法,于是对原生的 ...

  8. 复习练习(03)jquery Css方法一步步升级

    jquery Css方法一步步升级 <script src="jquery-1.8.3.js"></script> <script type=&quo ...

  9. JQUERY操作css与css()方法、获取设置尺寸;

    一.jQuery addClass() 方法 向不同的元素添加 class 属性.在添加类时,您也可以选取多个元素 <style> .aa { color:red; }; </sty ...

随机推荐

  1. siem主流厂商

    http://www.scmagazine.com/siem/products/6428/5/ http://www.edu.cn/wlaq_6572/20131217/t20131217_10532 ...

  2. Cylinder

    http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2374 思路:三分枚举. #include &l ...

  3. Sequence《优先队列》

    Description Given m sequences, each contains n non-negative integer. Now we may select one number fr ...

  4. 关于如何在BCB中使用CodeGuard

    作者:深圳虫 来自:深圳虫网本文来自http://www.szbug.com/disparticle.aspID=4 一. 为什么写这篇东西自己在使用BCB5写一些程序时需要检查很多东西,例如内存泄漏 ...

  5. Word Pattern

    ​package cn.edu.xidian.sselab.hashtable; import java.util.HashMap;import java.util.Map; /** *  * @au ...

  6. Hash unique和Sort unique

    SQL> set linesize 200 SQL> set pagesize 200 SQL> set autot trace SQL> select distinct de ...

  7. bzoj3709

    首先明显会想到贪心对于那些怪物回血比耗血多的,我们显然应该先打耗血少的那些回血比耗血多的怎么办呢?由于不管怎么打(假设体力负数了还能打),最终体力是一定,我们从最终体力倒推,相当于先吃药掉血,打怪物回 ...

  8. 今天知道了一个 反向代理,是apache 的一个功能,这里记录一下

    什么事情都需要自己 去弄,记住了这句话,不要以为 别人会来帮你 在 apache 的http.conf 文件中(去掉注释) LoadModule proxy_module modules/mod_pr ...

  9. 暴力求解——除法 Division,UVa 725

    Description Write a program that finds and displays all pairs of 5-digit numbers that between them u ...

  10. GPRS

    互动百科http://www.baike.com/wiki/GPRS 百度百科http://baike.baidu.com/link?url=M-ElL_qR1bwzUr7BdrDgN4EzBhYYJ ...