2017-07-06 133 views
-4

I'm making a website (for schoolwork) using a combination of php, html and css. I'm currently working on the initial design stages of my site and as I'm inexperienced at html/css, I am going slowly through tutorials trying to learn.做一個HMTL <a href> hyperlink not appear as a hyperlink

Including the hyperlink my banner looks like:banner with hyperlink

不包括我的旗幟看起來像超鏈接:banner without hyperlink

我想有鏈接的功能,但沒有鏈接視覺設計效果。

必要的代碼是:

<html> 
    <head> 
     <link rel="stylesheet" type="text/css" href="style.css"> 
    </head> 
    <center> 
    <div id = "indexBackgroundOne"><h2 style="font-family:verdana"> Q U E S T S &reg;</h2></div> 
    </center> 
</html> 

謝謝!

回答

2

如果您正在使用內聯CSS,你可以使用這樣的 -

<html> 
    <head> 
     <link rel="stylesheet" type="text/css" href="style.css"> 
    </head> 
    <center> 
    <div id = "indexBackgroundOne"><h2 style="font-family:verdana;text-decoration: none;color:black;"><a href="" style="text-decoration: none;color:black;"> Q U E S T S &reg;</a></h2></div> 
    </center> 
</html> 
0

在你的style.css文件

#indexBackgroundOne h2 a{ 
    text-decoration: none; 
    color:black; 
} 

這裏嘗試這是一個示例代碼:

<html> 
 
    <head> 
 
     <link rel="stylesheet" type="text/css" href="style.css"> 
 
    </head> 
 
    <style> 
 
    #indexBackgroundOne h2 a{ 
 
     text-decoration: none; 
 
     color:black; 
 
    } 
 
    </style> 
 
    <center> 
 
    <div id = "indexBackgroundOne"><h2 style="font-family:verdana"> Q U E S T S &reg;</h2></div> 
 
    </center> 
 
</html>

+0

這並不包括鏈接 – Mindless

+0

@Mindless,對不起,現在它 – user10089632

0

嘗試一下本作想要的效果:

.no-style { 
 
    text-decoration: none; 
 
    color: black; 
 
}
<center> 
 
    <div id = "indexBackgroundOne"> 
 
     <h2 style="font-family:verdana"> 
 
      <a href="" class="no-style">Q U E S T S &reg;</a> 
 
     </h2> 
 
    </div> 
 
</center>

,或者如果你想內嵌樣式:

<center> 
 
    <div id = "indexBackgroundOne"> 
 
     <h2 style="font-family:verdana;"> 
 
      <a href="" style="text-decoration:none;color:black;"> Q U E S T S &reg; 
 
      </a> 
 
     </h2> 
 
    </div> 
 
</center>

0

.noline{ 
 
text-decoration:none; 
 
}
<html> 
 
    <head> 
 
     <link rel="stylesheet" type="text/css" href="style.css"> 
 
    </head> 
 
    <center> 
 
    <div id = "indexBackgroundOne"><a class="noline"href="#your link"><h2 style="font-family:verdana"> Q U E S T S &reg;</h2></a></div> 
 
    </center> 
 
</html>

你可以做一個類,並把它添加到,讓文字修飾:無在CSS