0

好的,所以我正在用 HTML/Css 做一个网站问题是,当我单击“主页”按钮时,它会将我定向到我的 css 链接。我的主页被称为“new.html”,当我点击“home”而不是 background.css 时,我希望它去那里这是我的“New.html”

    <html>
    <head>
    <link rel="stylesheet" type="text/css" href="background.css"/>
    </head>
    <h1>Bully-Free Zone</h1>
    <h2>"Online harassment has an off-line impact"</h2>
    <a href="background.css" class="nav-link">Home</a>
    </body>
    </html>

背景.css

body{/* IE10 */ 
background-image: -ms-linear-gradient(top left, #FC5B5B 0%, #555BB5 100%);

/* Mozilla Firefox */ 
background-image: -moz-linear-gradient(top left, #FC5B5B 0%, #555BB5 100%);

/* Opera */ 
background-image: -o-linear-gradient(top left, #FC5B5B 0%, #555BB5 100%);


/* Webkit (Chrome 11+) */ 
background-image: -webkit-linear-gradient(top left, #FC5B5B 0%, #555BB5 100%);

/* Proposed W3C Markup */ 
background-image: linear-gradient(top left, #FC5B5B 0%, #555BB5 100%);
}
h1{color:black;text-align:center;font-size:40px;font-family:broadway;
}
h2{color:black; text-align:center;font-size:35px;font-style:italic;}
a{color:black; text-align:left; font-size:25px;font-family:broadway;}
a.nav-link:link
{
 color: black;
 text-decoration: none;
}
a.nav-link:visited
{
 color: black;
 text-decoration: none;
}
a.nav-link:hover
{
   color: black;
   text-decoration: none;
}
a.nav-link:active
{
   color: black;
   text-decoration: none;
}
4

3 回答 3

3

不是很明显吗?改变这个:

<a href="background.css" class="nav-link">Home</a>

对此:

<a href="new.html" class="nav-link">Home</a>

计算机只做它被告知要做的事情。

于 2012-04-16T20:43:44.077 回答
1

改变

<a href="background.css" class="nav-link">Home</a>

到:

<a href="new.html" class="nav-link">Home</a>

您还应该插入

<body>

在你之前

<h1>
于 2012-04-16T20:45:01.537 回答
0

更改此行:

<a href="background.css" class="nav-link">Home</a>

<a href="new.html" class="nav-link">Home</a>
于 2012-04-16T20:46:17.010 回答