Whack-a-mole(打地鼠)

本文探讨了前端开发中几个实用的技巧,包括flex布局的应用、setTimeout()的使用详解、classList属性的操作方法以及line-height属性的不同设置方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

源码传送门:https://github.com/yycer/share

这里写图片描述

几个小问题
1.flex布局

传送门:http://blog.youkuaiyun.com/m0_37851778/article/details/77241009

2.setTimeout()

setTimeout(()=> timeUp = true , 10000);

//等价于
setTimeout(function(){
    timeUp = true;
},10000);

3.classList属性返回元素的类名,作为DOMTokenList对象。

该属性是只读的,但可使用以下方法修改它。
①add(class1,class2,...)
②remove(class1,class2,...)
③toggle(class,true|false)
④item(index)
⑤contain(class)

4.line-height
http://cssreference.io/property/line-height/

line-height行高:两行文字间基线(base line)的距离。
②line-height: normal;line-height: 1.6;--- the line height will be relative to the font size.
④line-height: 30px;line-height: 0.8em;--- the line height will be relative to the font size.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值