我有一個簡單的標題與img和導航欄。我希望導航欄出現在img下面(這是發生了什麼),但導航欄出現在下面的文本後面。我無法弄清楚如何讓文本在導航欄下面並停止覆蓋它(已經嘗試了清楚)。導航欄覆蓋以下文本
我想提一提我是新來的,所以我可以看看很簡單。
精彩的jsfiddle鏈接:http://jsfiddle.net/k2qQN/
然後,這裏是我的html:
<
header role="banner">
<img src="../assets/images/autologo.png" alt="A and B automotive logo" />
<nav role="navigation">
<ul>
<li><a href="#about-us/about-us.html">Services</a></li>
<li><a href="#getting-in-touch">Getting in Touch</a></li>
<li><a href="about-the-shop/about-the-shop.html">About Us</a></li>
</ul>
</nav>
</header>
<div role="main">
<section id="services" title="Small overview of service">
<h1>Title for content</h1>
<p> At <a href="getting-in-touch">Some shop</a> Some random text following infoome random text following infoome random text following infoome random text following infoome random text following infoome random text following infoome random text following infoome random text following infoome random text following infoome random text following info</p>
</section>
這裏是CSS:
html, body, #container {
height: 100%;
width: 100%;
border: 1px solid black;
font-size: 1.1em;
}
header {
height: 20%;
width: 100%;
}
img {
height: 100%;
width: auto;
}
您在瀏覽哪個瀏覽器? – Techmonk 2013-03-05 09:23:52
Chrome和火狐 – user2093601 2013-03-05 09:25:43
Firefox上的小提琴看起來不錯...它可能是圖像高度的原因:100%也許?由於圖像沒有加載的課程 – Techmonk 2013-03-05 09:27:12