将导航栏置于精确位置

时间:2015-08-29 03:27:26

标签: html5 css3

我希望导航位于右下角(当然在标题中)。

我不想要自举解决方案,但我只想要纯CSS和HTML。谢谢:))

代码:



header {
  background: #1abc9c;
  height: 150px;
}
nav {
  float: right;
  padding: 130px 0px 90px 0px;
}
nav ul {} nav ul li {
  float: left;
  padding: 0px 0px 50px 0px;
  list-style: none;
  padding: 3px;
}
a {
  color: white;
  text-decoration: none;
  display: block;
  font-size: 180%;
}
nav > a:hover {
  text-decoration: underline;
  color: white;
}

<body>
  <header>
    <nav>
      <ul>
        <li><a href="#"><b>Home</b></a>
        </li>
        <li><a href="#"><b>About</b></a>
        </li>
        <li><a href="#"><b>Portfolio</b></a>
        </li>
        <li><a href="#"><b>Contact</b></a>
        </li>
      </ul>
    </nav>
  </header>
  <section id="first">
  </section>
  <section id="second">
  </section>
  <section id="third">
  </section>
  <section id="fourth">
  </section>
  <footer>
  </footer>
</body>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

修改css规则如下。这将有效

DateTimeBox22