我正在编码一个小型网站,但在编码时遇到错误。 我想制作一个导航栏,所以作为我,我抬起头来找到了一个。不幸的是,它使用了内部CSS,这不是我的麻烦,所以我尝试将其放置在引号中:
SQL> select * from test;
no rows selected
进入外观样式表,如下所示:
<html>
<head>
<link rel="stylesheet" type="text/css" href="nav.css">
<style>
"ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
position: fixed;
top: 0;
width: 100%;
}
li {
float: left;
border-right:1px solid #bbb;
}
li:last-child {
border-right: 1px solid #bbb;
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover:not(.active) {
background-color: #111;
}
.active {
background-color: #4CAF50;
}"
</style>
</head>
<body>
</body>
*/Stuff was here that the CSS corresponded to
</head>
<html>
但是,瞧,它没有用……有人知道为什么吗? (原谅我,如果我搞砸了,我是新来的)
编辑: 这是所有代码:
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
position: fixed;
top: 0;
width: 100%;
}
li {
float: left;
border-right:1px solid #bbb;
}
li:last-child {
border-right: 1px solid #bbb;
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover:not(.active) {
background-color: #111;
}
.active {
background-color: #4CAF50;
}
我想放这部分代码:
<html lang="en">
<head>
<title>Evstotskian Alliance</title>
<link rel="stylesheet" type="text/css" href="mainpage.css">
<link rel="stylesheet" type="text/css" href="nav.css">
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
position: fixed;
top: 0;
width: 100%;
}
li {
float: left;
border-right:1px solid #bbb;
}
li:last-child {
border-right: 1px solid #bbb;
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover:not(.active) {
background-color: #111;
}
.active {
background-color: #4CAF50;
}
</style>
</head>
<body>
<ul>
<li><a class="active" href="mainpage.html">Main Page</a></li>
<li><a href="nations/nationlist.html">List of Nations</a></li>
<li><a href="discord.html">Discord</a></li>
<li><a href="about.html">About</a></li>
</ul>
<br>
<h1>Welcome to the official website of the Evstotskian Alliance</h1>
<h2>About the Alliance</h2>
<p>The Evstotskian Alliance is a group of nations that strive to
help and benifits each other. Founded by Evstotska and Babilandia
the alliance was created in the Great Kieven War, after the war
Evan Wheeler decided no small nation shall be attacked by a giant.
Kiev is now an alliance leader along with Evstotska, Lakeland and
other nations.</p>
</body>
</html>
放入已在代码(navbar.css)中定义的外部文件表中,但是当我复制并粘贴到其中一个文件时,它不会将列表显示为导航条,这是内部CSS所做的。 这就是我需要帮助的东西。 我也是本地托管的,所以没有域名 感谢您的耐心等候