我最初的HTML代码看起来像这样
<!DOCTYPE html>
<head>
<title> MDMX Music </title>
<link rel="stylesheet" href="css\style.css">
</head>
</body>
<div class = "container">
<h1> MY HEADING </h1>
<p>Website text</p>
</div>我把它改成
<!DOCTYPE html>
<head>
<title> MDMX Music </title>
<link rel="stylesheet" href="css\style.css">
</head>
</body>
<div class = "container">
<h1><a href = "index.html"> MY HEADING </a></h1>
<p>Website text</p>
</div>CSS如下所示:
h1 {
font-family: "Courier New";
font-size: 600%;
color: darkorange;
text-transform: uppercase;
text-align: center;
margin: 0;
display: block;
text-align: center;
margin: 0;
display: block;
-webkit-mask-image: url(../images/rough-texture.png);
}而之前我得到了一个漂亮的大橙色纹理标题,现在我得到了一个很小的区域,其中有几个白点。
我似乎想不出是什么导致了这一切。
发布于 2017-03-08 20:48:58
您可以为h1锚点中的锚点a添加另一个特定规则,如下所示:
h1 a{
color: darkorange;
text-decoration: none;
}希望这能有所帮助。
h1{
font-family: "Courier New";
font-size: 200%;
color: darkorange;
text-transform: uppercase;
text-align: center;
margin: 0;
display: block;
text-align: center;
margin: 0;
display: block;
-webkit-mask-image: url("http://ghostlypixels.com/wp-content/uploads/2014/06/vector-line-texture.png");
}
h1 a{
color: darkorange;
text-decoration: none;
}<!DOCTYPE html>
<head>
<title> MDMX Music </title>
</head>
</body>
<div class = "container">
<h1> MY HEADING </h1>
<p>Website text</p>
</div>
And I changed it to
<!DOCTYPE html>
<head>
<title> MDMX Music </title>
</head>
</body>
<div class = "container">
<h1><a href = "index.html"> MY HEADING </a></h1>
<p>Website text</p>
</div>
发布于 2017-03-08 20:50:33
像这样试一下:
<a href = "index.html"><h1> MY HEADING</h1></a>https://stackoverflow.com/questions/42671745
复制相似问题