手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

jquery如何设置div内容的行高

时间:2024-10-12 03:37:21

1、新建一个html文件,命名为test.html,用于讲解jquery如何设置div内容的行高。

jquery如何设置div内容的行高

2、在test.html文件内,在div标签内放一段文字,并设置div的id为tete。

jquery如何设置div内容的行高

3、在css标签内,通过id设置div的宽度为200px。

jquery如何设置div内容的行高

4、在js标签内,使用ready()方法在页面加载完成时执行function方法。

jquery如何设置div内容的行高

5、在function方法内,通过id获得div对象,使用css()方法将line-height属性设置为30px,即将行高设置为30px。

jquery如何设置div内容的行高

6、在浏览器打开test.html文件,查看实现的效果。

jquery如何设置div内容的行高
© 手抄报圈