我有一段这样的代码
<div class="col-md-9 text-center">
<a href="#">
<img class="img-responsive" style="position: relative;
width: 175px; display: inline; margin-top: 3px;
margin-left: 448px;" src="/assets/header_other/reco.png">
</a>
</div>
如果您看到图像已被赋予 margin-left
。我面临的问题是,由于它是 col-md-9
,并且有一个 anchor 标记,整个 col-md-9
都充当 anchor 标记。
我该如何解决。
最佳答案
试试这个 将此样式添加到您的 anchor 标记
<div class="col-md-9 text-center">
<a href="#" style="float:left;display:block;margin-top: 3px;
margin-left: 448px;">
<img class="img-responsive" style="position: relative;
width: 175px; display: inline;" src="/assets/header_other/reco.png">
</a>
</div>
现在只有图像将具有 anchor 属性而不是整个 col-md-9 div
这就是所有的人
关于html - 从 col-md-9 中删除 anchor 并将其保留为仅图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34059471/