2017-06-22 114 views
0

我有兩個div充當鏈接(<a>)。一段一段,另一段在第二段。第二個鏈接工作:在鼠標懸停(在Chrome中)窗口的左下角顯示鏈接地址。最上面的一個不會這樣做。哪裏不對?我正在談論段落標籤中的鏈接,而不是菜單鏈接。HTML超鏈接不能用於段落

<body ontouchstart> 
<div class="header"> 
    <div class="logo">Q<sup>3</sup></div> 
    <div class="desc">Quito's Qustom Qode</div> 
    </div> 

    <div class="row"> 
    <div class="sidenav col2"> 
    <a id="about" class="link-active">about</a> 
    <a id="pricing">pricing</a> 
    <a id="projects">projects</a> 
    <a id="legal">legal</a> 
    </div> 
    </div><!-- /row --> 

    <div class="row"> 
    <div id="content" class="col10"> 
    <div class="info"> 

    <div class="about"> 

     <div class="profile-back"> 
     <div class="profile"></div> 
     </div> 

     <div class="about-me"> 
     <p>Kevin (Quito [Key'-tow]) Williams is an aspiring front-end web designer. He has 5 years of experience in HTML, 4 years experience in CSS, and is currently studying jQuery. As a modern web designer, he is using his coding background to study the latest web technologies: HTML5, CSS3, <a href="http://www.google.com">RWD</a>. In addition to his web technology languages, he is also familiar with: C<sup>++</sup>, Javascript, Java, Perl, Lua (Minecraft based), LISP, SQL. </p> 
     <p><a href="http://www.google.com">Hello</a></p> 
+0

add t arget =「_ blank」在你的href標籤中。檢查我的下面的答案。 – Reshma

+0

你的段落鏈接正常工作,只有我不知道你面對的是什麼問題..你給'''''RWD''''''http://www.google.com''和'''你好'''和兩個工作正常,並懸停在它也顯示窗口左下角的相應鏈接..我認爲這個問題只有你問,它的工作適合我..還要確保你張貼在正確的開始和結束標籤,這是在你的代碼中缺少很多東西在一個代碼在這裏stackoverflow。 –

回答

0

你能更清楚地知道你期待的結果嗎?

編輯:我想我現在明白,「關於」「定價」「項目」應該是超鏈接?

您在標籤中缺少應該解決問題的「href」屬性。

如果您不希望鏈接指向其他頁面,則可以使用href =「#」來停止此操作。

您是否關注以下幾行?

<a href="http://www.google.com">RWD</a>. 
    <p><a href="http://www.google.com">Hello</a></p> 

如果是這樣,兩個工作正常鉻和IE對我來說。我不確定你的問題是什麼。

0

您忘記了通過href添加錨定標記上的實際鏈接。

您當前的代碼:

<a id="about" class="link-active">about</a> 
<a id="pricing">pricing</a> 
<a id="projects">projects</a> 
<a id="legal">legal</a> 

變化:

<a href="#" id="about" class="link-active">about</a> 
<a href="#" id="pricing">pricing</a> 
<a href="#" id="projects">projects</a> 
<a href="#" id="legal">legal</a> 
0

試試這個代碼,添加目標= 「_空白」 在你的A HREF

<p><a href="http://www.google.com" target="_blank">Hello</a></p> 

和工作小提琴鏈接在這裏https://jsfiddle.net/p7mnsj3p/