影响其他html页面元素的表单

时间:2015-04-23 20:49:17

标签: html css

我在标题中说有形式问题。 这是一些图片

enter image description here

在此图片中,您可以在添加表单标记之前查看页面的外观。

enter image description here

当我在页面代码中添加任何地方时,会发生这种情况。 有人能告诉我,为什么会这样? 很抱歉没有提供CSS代码,但我只是不想把它全部放在这里。没有什么重要的,它的位置是固定的并且向左浮动。多数民众赞成。

#navigation {
  height: 50px;
  width: 100%;
  position: fixed;
  color: #e7e7e7;
}
#navigation .part {
  background-color: #171717;
  border-bottom: 2px solid #a00706;
  height: 48px;
  opacity: 0.8;
  filter: alpha(opacity=80);
  float: left;
}
#navigation .first {
  background: url('img/mini-ts.png') no-repeat center center;
  background-color: #171717;
  width: 150px;
  margin-right: 20px;
}
#navigation .second {
  width: 580px;
  margin-right: 20px;
  font-size: 14px;
}
  #menu {
    padding-left: 20px;
    padding-right: 20px;
    height: 48px;
  }
  #menu ul {
    float: left;
  }
  #menu li {
    list-style-type: none;
    float: left;
    width: 90px;
    height: 32px;
    text-align: center;
    padding-top: 16px;
    -webkit-transition: background 1.5s ease;
    -moz-transition: background 1.5s ease;
    -ms-transition: background 1.5s ease;
    -o-transition: background 1.5s ease;
    transition: background 1.5s ease;
  }
  #menu li:hover {
    -webkit-transition: background 1.5s ease;
    -moz-transition: background 1.5s ease;
    -ms-transition: background 1.5s ease;
    -o-transition: background 1.5s ease;
    transition: background 1.5s ease;
    background-color: #2f2f2f;
  }

#navigation .third {
  width: 230px;
}
  #search {
    background-color: #000000;
    height: 38px;
    margin-top: 5px;
    margin-bottom: 5px;
    width: 220px;
    margin-left: 5px;
    margin-right: 5px;
    overflow:hidden;
}
<div id="navigation">
      <div class="first part"></div>
      <div class="second part">
        <div id="menu">
          <ul>
            <a href=""><li>Sākums</li></a>
            <a href=""><li>Forums</li></a>
            <a href=""><li>Veikals</li></a>
            <a href=""><li>Turnīri</li></a>
            <a href=""><li>Komandas</li></a>
            <a href=""><li>Serveru īre</li></a>
          </ul>
        </div>
      </div>
      <div class="third part">
        <div id="search">

        </div>
      </div>
</div>

1 个答案:

答案 0 :(得分:0)

我使用<li>代替<nav>进行水平导航。