2017-07-06 95 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