inline-block基线原理的小图标对齐实例
1. 空标签后面跟随文本
删除
2. 标签里面有“删除”文本
删除随便什么文字
3. 字号变大
删除
删除随便什么文字
对应的css样式
.box {
line-height: 20px;
}
.icon {
display: inline-block;
width:20px; height:20px;
white-space: nowrap;
letter-spacing: -1em;
text-indent: -999em;
}
.icon:before {
content:’\3000’;
}
.icon-delete {
background: url(delete.png) no-repeat center;
}
.large {
font-size: 20px;
}