1.替换元素
<img>
效率最高2.如何将一个替换元素变成一个非替换
3.content的特性
4.content内容生成技术
5.padding属性
.box{
padding: 10% 50%;
position: reletive;
}
.box img{
position: absolute;
width: 100%;
height: 100%
left: 0;
top: 0
}
button{
position: absolute;
clip: rect(0,0,0,0);
}
label{
display: inline-block;
line-height: 20px;
padding: 10px;
}
<button id="btn"></button>
<label for="btn">click</label>
.icon{
display: inline-block;
width: 14px;
height: 1px;
padding: 3px 0;
border-top: 1px solid;
border-bottom: 1px solid;
background-color: currentColor;
background-clip: content-box;
}
6.margin属性
.column-box{
over-flow: hidden;
}
.son,
.child{
margin-bottom: -9999px;
padding-bottom: 9999px
}
margin: auto
的作用如果一侧定值,一侧auto,则auto为剩余空间大小(margin初始值为0) 如果两侧均是auto,则平分剩余空间
触发margin:auto
的前提条件是对应方向会自动填充,所以一般高度不会自适应,可以使用writing-mode: vertical-lr
改变文档流方向,而这样水平方向无法居中,所以需要设置position,将正常流宽度改变成格式化宽度和格式化高度
(1) 绝对定位元素非定为方向的margin值无效 (2)定高容器的子元素的margin-bottom或者定宽元素的子元素的margin-right无效
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有