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:
我想拥有链接的功能,但没有链接的视觉设计效果。
必要的代码是:
<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 ®</h2></div>
</center>
</html>
谢谢!
答案 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 ®</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 ®</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 ®</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 ®
</a>
</h2>
</div>
</center>
答案 3 :(得分:0)
.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 ®</h2></a></div>
</center>
</html>
&#13;
你可以创建一个类并将其添加到css
中并进行text-decoration:none