使 HTML <a href> 超链接不显示为超链接
Make a HMTL <a href> hyperlink not appear as a hyperlink
我正在使用 php、html 和 css 的组合制作一个网站(用于学校作业)。我目前正处于网站的初始设计阶段,由于我在 html / css 方面缺乏经验,我正在慢慢学习教程。
包括 hyperlink 我的横幅看起来像:
不包括 hyperlink 我的横幅看起来像:
我想有link的功能,但是没有link的视觉设计效果。
必要的代码是:
<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>
谢谢!
在你的 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>
试试这个以获得想要的效果:
.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>
如果你使用内联 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>
.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 ®</h2></a></div>
</center>
</html>
你可以制作一个class并将其添加到css
中并制作文字装饰:none
我正在使用 php、html 和 css 的组合制作一个网站(用于学校作业)。我目前正处于网站的初始设计阶段,由于我在 html / css 方面缺乏经验,我正在慢慢学习教程。
包括 hyperlink 我的横幅看起来像:
不包括 hyperlink 我的横幅看起来像:
我想有link的功能,但是没有link的视觉设计效果。
必要的代码是:
<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>
谢谢!
在你的 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>
试试这个以获得想要的效果:
.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>
如果你使用内联 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>
.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 ®</h2></a></div>
</center>
</html>
你可以制作一个class并将其添加到css
中并制作文字装饰:none