0

我想将 a 浮动<p>到 a 的底部<div>,但据我所知,我不能将父级设置<div>position:relativeposition:absolute不破坏我的布局,该布局使用 Compass 的 Susy 框架。

我还能怎么做?

相关的 HTML 是:

<header>
  <div class='grid'>
    <div class='logo'>
      <img src='/images/logo3.png'>
    </div>
    <div class='tagline'>
      <p>Fast Facts About Your Website, Your Competition, And Best Practice</p>
    </div>
  </div>
</header>

相关的CSS是:

header {
  clear: both;
}

.grid .logo {
  width: 30.43478%;
  float: left;
  margin-right: 4.34783%;
  display: inline;
  padding-left: 3.75em;
  margin: 0;
}

.grid .tagline {
  width: 65.21739%;
  float: right;
  margin-right: 0;
  #margin-left: -3.75em;
  display: inline;
}
4

1 回答 1

0

据我从您的问题中了解到,您需要<p>My Fiddlelogo之后清除您的浮动logo div

<div style="clear: both;"></div>
<div class='tagline'>
  <p>Fast Facts About Your Website, Your Competition, And Best Practice</p>
</div>

为什么要使用浮动宽度?有必要这么准确吗?为什么display: inline;.logo.tagline

于 2012-10-13T10:00:23.397 回答