zoukankan      html  css  js  c++  java
  • 基本选择器

    html文件:

    <!DOCTYPE html>
    <html lang="en">
    <head>
    	<meta charset="UTF-8">
    	<title>基本选择器</title>
    </head>
    <body>
    	<ul>
    	<li>1</li>
    	<li>2</li>
    	<li>3</li>
    	<li id="four">4</li>
    	<li>5</li>
    	<li class="green yellow">6</li>
    	<li class="green">7</li>
    	<li>8</li>
    	<li>9</li>
    	<li>10</li>
    	</ul>
    	<div class="green">111</div>
    	<div class="green">111</div>
    	<div class="green">111</div>
    	<div class="green">111</div>
    	<script src="jquery-1.12.4.js"></script>
    	<script>
    	//入口函数
    	$(function(){   
        //jquery如何设置样式
        //css(name, value)
        //name:样式名  value:样式值
        //id选择器  $("#id")
        //$("#four").css("backgroundColor", "red");
        //$(".green").css("backgroundColor", "green");
        //$("li").css("color", "red");
        //交集 并集
        //$("#four,.green").css("backgroundColor", "pink");
        //$("li.green").css("backgroundColor", "red");
        $(".green.yellow").css("backgroundColor", "pink");
      });
    	</script>
    </body>
    </html>
    

      

  • 相关阅读:
    计算机网络协议如何学习之换位思考
    tcp/ip协议
    JSP页面中的元素
    动态网页脚本语言
    php的学习经验
    jsp、php和asp之间的区别
    Reactor 线程模型
    Hadoop集群搭建
    hadoop单点配置
    Docker 安装脚本
  • 原文地址:https://www.cnblogs.com/luwn/p/12705113.html
Copyright © 2011-2022 走看看