制作HMTL <a href=""> hyperlink not appear as a hyperlink

时间:2017-07-06 03:37:34

标签: html css hyperlink href

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.

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>

谢谢!

4 个答案:

答案 0 :(得分: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>

答案 1 :(得分: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>

答案 2 :(得分: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>

答案 3 :(得分:0)

&#13;
&#13;
.noline{
text-decoration:none;
}
&#13;
<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>
&#13;
&#13;
&#13;

你可以创建一个类并将其添加到css

中并进行text-decoration:none