gpt4 book ai didi

css - 我可以使用 after 伪类来创建目标图像吗?

转载 作者:太空宇宙 更新时间:2023-11-04 00:06:31 25 4
gpt4 key购买 nike

所以我在这里得到了这个 css:

.outerDot {
width: 50px;
height: 50px;
background: white;
border: 4px solid blue;
border-radius: 50px;
}
.outerDot:after {
background: blue;
width: 20px;
height: 20px;
}

我想要 .outerDot:after出现在.outerDot里面.我是不是找错树了? JsFiddle

html 只是 <div class="outerDot"></div> .

最佳答案

您必须添加一个content 属性,并使其显示 block :

.outerDot:after {
content: '';
display: block;
background: blue;
width: 20px;
height: 20px;
}

这是你的 fiddle :http://jsfiddle.net/hV93X/2/

关于css - 我可以使用 after 伪类来创建目标图像吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14695558/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com