2014-11-04 166 views
-3

我試圖把標題,但沒有成功的導航欄。我在這個網站上搜索過,但我找不到答案。標題上的導航欄?

EDITED:添加標記html。

Here the picture

<!DOCTYPE html> 
<html lang="en"> 
<head> 
<title>"New York City"</title> 
<meta charset="uft-8"> 
<style> 


@font-face { 
    font-family: Breamcatcher; src: url('Breamcatcher.ttf'); 
} 

body { 
    background: url("New York City Night.jpg"); 
    background-repeat: no-repeat; 
    background-size: cover; 
    -moz-background-size: cover; 
    -o-background-size: cover; 
    -webkit-background-size: cover; 
} 

#header { 
    margin: auto; 
    background-color: black; 
    /*Opacity start*/ 
    opacity: 0.8; 
    filter: alpha(opacity=80); /* For IE8 and eariler */ 
    /*Opacity end*/ 
    font-family: Breamcatcher, san-serif; 
    font-size: 500%; 
    text-align: center; 
    top: 0; 
    left: 0; 
    width: 1000px; 
    height: 300px; 
    padding: 0; 
} 

span.header2 { 
    margin: auto; 
    color: orange; 
    font-size: 185%; 
} 

    </style> 
    </head> 
    <body> 

    <div id="header"><span class="header2"> New York City </span></div> 

    </body> 
    </html> 

我如何把它的頭?另外我如何添加徽標?謝謝!

Here the picture

+1

有任何需要發佈的HTML嗎? – starvator 2014-11-04 20:06:37

+1

也分享您的標記HTML – DaniP 2014-11-04 20:06:45

+1

指向您的網站的鏈接(如果已發佈) – 2014-11-04 20:11:14

回答

0

我會嘗試幫助您完成此,即使你還沒有真正給了我們太多的信息去了。

基本上,您將要在報頭中添加一個無序列表來表示您的鏈接。這不是添加導航菜單的唯一方式,但它是最常用的方法之一。你可以是這樣做的:

<div id="header"> 
    <span class="header2">New York City</span> 
    <nav> 
     <ul> 
      <li><a href="#">Home</a></li> 
      <li><a href="#">About</a></li> 
      <li><a href="#">Press</a></li> 
      <li><a href="#">Contact</a></li> 
     </ul> 
    </nav> 
</div> 

然後,你需要添加一些CSS,這樣在一個水平線上像這樣list items顯示:

nav ul > li { 
    display:inline-block; 
    font-size:16px; 
} 

你可以看到一個例子(沒有背景圖片)here。從那裏你可以添加更多的CSS,使它看起來像你想要的。

您還提到想添加徽標,除了您目前在頭文件中的span之外,您還有沒有提及?我會認爲「紐約市」span是「標誌」。如果您需要進一步的幫助,請給我們更多的代碼/細節。

最後一件事情是,你在title標記的「紐約市」周圍有引號。除非你打算讓他們在那裏,否則這些引號是沒有必要的。