我想在所有 div 下面显示一些消息。但是显示在div里面。
我上传我的 css 和 html 代码以及输出快照。
.round .shape{
background-size: 560px;
background-position: 0px 2px;
width: 66px;
height: 69px;
background-repeat: no-repeat;
display: inline-block;
}
.img.shape {
border: 1px solid #eee;
}
.img
{
margin-right: 52px;
margin-top: 20px;
}
.shape
{
background-image: url('../images/diamondshape.jpg');
}
<label for="ABC" class="round">
<div class="img shape" ></div>
<span>A</span>
</label>
最佳答案
把data span改成div可以吗??如果您将该跨度更改为 div 那么它就可以正常工作......试试这个
.round .shape{
background-size: 560px;
background-position: 0px 2px;
width: 66px;
height: 69px;
background-repeat: no-repeat;
display: inline-block;
}
.img.shape {
border: 1px solid #eee;
}
.img
{
margin-right: 52px;
margin-top: 20px;
}
.shape
{
background-image: url('../images/diamondshape.jpg');
}
<label for="ABC" class="round">
<div class="img shape" ></div>
<div>A</div>
</label>
关于html - 如何在所有div下方显示文字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44236357/