<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
通配符选择器 *
*{
margin: 0;
padding: 0;
}
#div1{
width: 100px;
height: 100px;
}
.div2{
width: 100px;
height: 100px;
}
</style>
<script src="js/jquery-3.1.0.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(document).ready(function(){
基础选择器
id选择器: #+id值
$("#div1");
$("#div1").css("background-color","royalblue")
class选择器:.+class值
$(".div2");
$(".div2").css("background-color","black")
标签选择器:标签名
$("div").css("border","1px solid yellow")
})
</script>
</head
<body>
<div id="div1"></div>
<div class="div2"></div>
</body>
</html>