会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
鲁小肃
When you stop trying,you make the failure completely
博客园
首页
新随笔
联系
订阅
管理
2018年5月1日
获取display:none的元素的宽度和高度
摘要: display为none的元素不能通过offsetWidth和offsetHeight来获取宽高(未参与css渲染), 解决方案:可以通过在display为none的元素使用行内样式style设置宽高,通过style.width 和style.height获取, 注意:样式不能写字css文件中。否则
阅读全文
posted @ 2018-05-01 22:37 稀算客
阅读(3228)
评论(0)
推荐(0)
编辑
公告