特定的id选择器不能通过css设置进行边距

时间:2013-06-06 17:32:24

标签: html css

HTML

<div class="row-fluid" id="content-row">
      <div class="span12">
        <div class="row-fluid">
          <div class="span4" id="home-logo">
            <img src="img/layout/logo.png" id="logo">

                  <ul id="subnav">
                        <!-- Loaded via AJAX -->
                  </ul>

          </div><!-- ./span4 -->
          <div class="span8" id="home-copy">
            <p id="home-p">
                Foxcode is an investment and merchant banking Firm which advises and invests in small to mid-market companies and projects globally.
            </p>
          </div><!-- ./span8 -->
        </div><!-- ./row-fluid -->
      </div><!-- span12 -->
    </div><!-- ./row-fluid -->

我尝试设置#subnav{margin-left: }#subnav li{margin-left: }来控制元素位置,使其向右移动一点,但是当我尝试时没有任何反应。

关注元素

<ul id="subnav">
    <!-- Loaded via AJAX -->
</ul>

1 个答案:

答案 0 :(得分:1)

尝试添加到您的CSS:

#subnav{
    padding:0px;
    margin:0px;
    margin-left:10px;
}

JSFiddle