html - 从 col-md-9 中删除 anchor 并将其保留为仅图像

标签 html css twitter-bootstrap

我有一段这样的代码

<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/

相关文章:

javascript - 带有事件选项卡的动态 Bootstrap 导航

javascript - 按类获取节点的子节点(HTML 模板)

html - 在同一行中将图像向右移动

html - span、input 和 div 元素之间有什么区别?

css - 使用 ruby​​ on rails 正确放置链接

html - iOS 上双滚动的溢出隐藏问题

javascript - 如何让博主其中一个页面的内容占据整个页面的框架

html - 使用选项卡内的列时不显示选项卡背景

python - Flask静态文件获取404

html - 如何设置输入文本的背景颜色?