html - bootstrap 中连续的 margin 属性

标签 html css twitter-bootstrap

我编写了这个简单的 code :

HTML

    <div class="row offset3">
      <div class="title">Title1</div>
        <div class="title-arrow">
           <a href="#"><i class="icon-arrow-left"></i>GoBack</a>
        </div>
    </div> 

CSS

   .title{
      margin-top: 20px;
    }

   .title-arrow{
      margin-top: -22px;
      margin-left: 50px;
      margin-bottom: 14px;
    }

我的问题是,如果我将 Title1 更改为更大的标题,例如 titllleeeeeeeeeeeeeeee 箭头不会向右移动.. 好的我明白了它的正常行为!我必须在类(class)标题中加上属性(property) margin 。我试图放置一个 margin-right:10px; 但没有任何反应..

最佳答案

只需这样做:

HTML:

<div class="row offset3">
  <div class="title">Titleaa</div>
    <span class="title-arrow">
       <a href="#"><i class="icon-arrow-left"></i>GoBack</a>
    </span>
</div>

CSS

   .title{
      margin-top: 20px;
      display: inline;
    }

DEMO

title-arrow 不再需要了,但它在那里以备不时之需。

关于html - bootstrap 中连续的 margin 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19046876/

相关文章:

php - 如何在PHP中+(加法)值(数字)在一起?

php - 在 php mysql 中插入和检索图像

javascript - 如何从 JavaScript 设置和触发 css 转换

jquery - css 变换比例和 jquery bug

javascript - vimeo 视频达到特定秒数时如何显示 div?

php - SQL PHP : How to select some column from sql database and display it in PHP/HTML generated table in descending order where condition is. ..

php - 价格低-高/高-低过滤 PHP/Mysql

html - 在 django bootstrap 中缩小文本输入字段的大小

javascript - ASP.NET MVC 验证不适用于 Bootstrap 模式

twitter-bootstrap - 如何获得非 <a> 元素的链接外观?