html伪元素before占用高度,使用before伪元素出现的问题?

bVrogc

before,after会占据元素里边的空间,我一直以为是占据外边的空间。

如果不用nowrap元素就会换行是为什么?

为什么设置inline-block不会包含整个标签了?

怎样让他全部都包含到?

伪元素为什么用不了百分比设置高度,宽度却可以用百分比?

考虑到自适应手机端这样做是不是最好的选择?

哈哈哈啊哈哈哈哈哈哈哈哈

.column_05,.column_06{

text-align: center;

}

.column_05 .til,.column_06 .til{

display: inline-block;

position: relative;

text-align: center;

font-size: 2.4rem;

color: #16003a;

margin: 20px auto;

line-height: 25px;

text-align: center;

white-space: nowrap;

}

.column_05 .til:before,.column_06 .til:before{

content: "";

display: inline-block;

width: 10%;

height: 20px;

margin-left: 5%;

background: url(../images/title_before.png) no-repeat;

background-size: contain;

}

.column_05 .til:after,.column_06 .til:after{

content: "";

margin-right: 5%;

display: inline-block;

width: 10%;

height: 20px;

background: url(../images/title_after.png) no-repeat;

background-size: contain;

}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值