1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <script type="text/javascript" src="jquery-1.11.3.min.js"></script> 6 <title>Title</title> 7 </head> 8 <body> 9 <div>你好</div> 10 <p>你好</p> 11 <h1>你好</h1> 12 <script type="text/javascript"> 13 $(document).ready(function(){ 14 //jquery add()方法是选择更多的元素 15 $("div").add("p").add("h1").css({"width":"100px","height":"100px","background":"orange","display":"inline-table"}); 16 }); 17 </script> 18 </body> 19 </html>
转载于:https://www.cnblogs.com/wujindong/p/5255780.html