当前位置: 移动技术网 > IT编程>开发语言>JavaScript > jQuery设置指定网页元素宽度和高度的方法教程

jQuery设置指定网页元素宽度和高度的方法教程

2019年05月17日  | 移动技术网IT编程  | 我要评论

本文实例讲述了jquery设置指定网页元素宽度和高度的方法。分享给大家供大家参考。具体实现方法如下:

<!doctype html>
<html>
<head>
<script src="js/jquery.min.js">
</script>
<script>
$(document).ready(function(){
 $("button").click(function(){
  $("#p1").width(500).height(500);
 });
});
</script>
</head>
<body>
<p id="p1" style="height:100px;width:300px;padding:10px;margin:3px;border:1px solid blue;background-color:lightblue;">
</p>
<br>
<button>resize p</button>
</body>
</html>


如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网