HTML图像和文本
代码: 谷歌 谷歌游戏商店 谷歌Gmail GmailHTML图像和文本,html,css,Html,Css,代码: 谷歌 谷歌游戏商店 谷歌Gmail Gmail 尝试将align=bottom添加到图像标记,或在文本字符串之前添加足够的内容,直到文本字符串显示在图像下方。Hy 首先从两个图像中删除float:left和float:right 然后你只需要添加这个CSS代码 .leftimage>img{ display: block; margin-left:auto; margin-right:auto; } 使用此代码这将解决您的问题,问题是您已将float选项放置在ima
尝试将align=bottom添加到图像标记,或在文本字符串之前添加足够的内容,直到文本字符串显示在图像下方。Hy 首先从两个图像中删除float:left和float:right 然后你只需要添加这个CSS代码
.leftimage>img{
display: block;
margin-left:auto;
margin-right:auto;
}
使用此代码这将解决您的问题,问题是您已将float选项放置在image而不是div中,如果无法工作,请让我知道。非常感谢。这是代码笔链接
当你使用float时,你必须使用clear:在这里,你可以使用text left或text right来代替text center来获得你想要的结果。仍然需要像image 2 center那样的图像,但如果我添加float,文本有误,请检查这里,你不希望一切正常吗,我想知道你有独立的CSS吗?因为我不想链接外部css崩溃与我目前的网站
<div class="row py-4">
<div class="col-12 mb-3 col-md-6 text-center leftimage" style="float:left;">
<img src="https://content.fortune.com/wp-content/uploads/2017/01/google.jpeg" class="img-fluid d-block" style="height:640px;text-align:center;" alt="Google">
<b><h3> Google </h3></b>
<p> Google Play Store </p>
<a href="" class="btn btn-primary">Link</a>
</div>
<div class="col-12 mb-3 col-md-6 text-center leftimage" style="float:right;">
<img src="https://images.livemint.com/img/2019/09/12/600x338/TA_-_2019-09-12T171956.640_1568289017643.png" class="img-fluid d-block" style="height:640px;text-align:center;" alt="Gmail">
<b> <h3> Google Gmail </h3> </b>
<p> Gmail </p> <br>
<a href="" class="btn btn-primary">Link</a>
</div>
<div class="row py-4">
<div class="col-12 mb-3 col-md-6" >
<img src="https://content.fortune.com/wp-content/uploads/2017/01/google.jpeg" class="img-fluid d-block" style="width:512px;height:640px;" alt="Google">
<div class="caption">
<b><h3> Google </h3></b>
<p> Google Play Store </p>
<a href="" class="btn btn-primary">Link</a>
</div>
</div>
<div class="col-12 mb-3 col-md-6">
<img src="https://images.livemint.com/img/2019/09/12/600x338/TA_-_2019-09-12T171956.640_1568289017643.png" class="img-fluid d-block" style="width:512px;height:640px; float:left" alt="Gmail">
<div class="caption">
<b> <h3> Google Gmail </h3> </b>
<p> Gmail </p> <br>
<a href="" class="btn btn-primary">Link</a>
</div>
</div>
</div>