html - 如何更改 HTML 列表项的颜色(颜色:firebrick 不起作用
问题描述
正如您将在 css 链接中看到的那样,我已经尝试了在我能想到的所有内容中尝试 color:firebrick 的明显方法。这是谷歌说要做的唯一事情。在使我的列表内联之前,我对其进行了一系列编辑,但我认为这将是一个简单的修复,因为它一开始就很容易做到。
我希望问“我的代码有什么问题”对于指南来说不是太具体,但我很难过。
我知道标题似乎是一个很容易用谷歌搜索的重复问题。但是我研究过的任何东西都没有解决它。
我需要它看起来像这样:
这是我到目前为止所拥有的:
#headings {
background-color: firebrick;
font-family: Arial, Helvetica, sans-serif;
padding-left: 3em;
padding-bottom: 0px;
margin-bottom: 0px;
}
#headings h1 {
color: white;
padding-top: 0px;
margin-top: 0px;
padding-bottom: 0px;
margin-bottom: 0px;
}
h2 {
color: thistle;
font-family: Arial, Helvetica, sans-serif;
padding-left: 3em;
padding-bottom: 0px;
margin-bottom: 0px;
}
#nav {
background-color: lightgrey;
color: firebrick;
padding: 0px;
margin: 0px;
}
#nav ul {
color: firebrick;
padding: 0px;
margin: 0px;
}
#nav li {
color: firebrick;
text-decoration: none;
display: inline;
padding-right: 10%;
padding-left: 4%;
}
#content {
padding: 2em;
}
.figure {
float: right;
width: 30%;
margin-right: 40px;
clear: both;
padding: 1em;
}
.equation {
text-align: center;
}
#footnotes {
text-align: center;
clear: both;
padding: 3em;
}
#footer {
text-align: center;
clear: both;
}
<html>
<head>
<link rel="stylesheet" type="text/css" href="HW2.css" />
<title>Math 300 Assignment 2</title>
</head>
<body>
<div id="headings">
<h1>A Mathematical Web</h1>
<h2>Roots of Polynomials</h2>
</div>
<div id="nav">
<ul>
<li><a href="http://math.wsu.edu/kcooper/M300/HWpoly_home.html">Home</a></li>
<li><a href="http://math.wsu.edu/kcooper/M300/HWpoly_quadratic.html">The Quadratic</a></li>
<li><a href="http://math.wsu.edu/kcooper/M300/HWpoly_cubic.html">The Cubic</a></li>
<li><a href="http://math.wsu.edu/kcooper/M300/HWpoly_quartic.html">The Quartic</a></li>
<li><a href="http://math.wsu.edu/kcooper/M300/HWpoly_galois.html">Galois Theory</a></li>
</ul>
</div>
<div id="content">
<h1>The Quadratic</h1>
<p>
A polynomial of degree two is called a quadratic, and an equation involving a quadratic polynomial whose value is zero is called a quadratic equation. The solutions of a quadratic equation are called the <i>roots</i> of the polynomial. Figure 1
shows the graph of a quadratic polynomial. The roots of the polynomial are the points where the graph crosses the <i>x</i>-axis.
</p>
<div class="figure">
<img src="https://upload.wikimedia.org/wikipedia/commons/f/f8/Polynomialdeg2.svg"> Figure 1. A quadratic polynomial<sup>*</sup>
</div>
<p></p>
<p>
The means of finding the roots of quadratic polynomials were known to the Babylonians and others thousands of years ago. Today, we can write our solutions more elegantly using modern mathematical notation. A general quadratic polynomial can be written
in the form
</p>
<p class="equation">
p(x) = ax<sup>2</sup> + bx + c.
</p>
<p>
Using this notation, we can write the roots of <i>p</i> as
</p>
<p class="equation">
( 1/(2a) ) ( -b ± [ b<sup>2</sup> - 4ac ]<sup>1/2</sup> ).
</p>
<p>
We can see that whenever <span class="equation">b<sup>2</sup> - 4ac < 0</span> then there are two complex roots with non-zero imaginary parts. If
<span class="equation">b<sup>2</sup> - 4ac = 0</span> then there is exactly one root, which is real. Otherwise, there are two real roots.
</p>
</div>
<div id="footnotes">
* By Original hand-drawn version: N.Mori Updated hand-drawn version: Rubber Duck (☮ • ✍) [Public domain], via Wikimedia Commons
</div>
<div id="footer">
Copyright © 2018 Kevin Cooper
</div>
</body>
</html>
解决方案
#nav li a
不添加颜色#nav li
#nav li a{
color: firebrick;
text-decoration: none;
}
#nav li
{
display: inline;
padding-right: 10%;
padding-left: 4%;
}
推荐阅读
- angular - 在同一模块中提供拦截器和依赖自定义服务的问题
- javascript - Javascript - 未捕获的 SyntaxError:条件中的意外标识符
- ms-access - 2010 访问 DoCmd.RunSavedImportExport 清除查询
- docker - React 应用程序(在 docker 容器中)无法访问 AWS EC2 上的 API(在 docker 容器中)
- bash - SSH 会话中远程设备的密码
- yii - Yii2 调试面板仅在出现错误时显示
- java - 如何使用okhttp获取异步调用以返回对主线程的响应?
- java - 谷歌地图:下载路线/轨迹的经度/纬度
- c# - 命令执行后转换器不会被调用
- c# - 在 C# 中将 Jenkins 与 .NET 项目一起使用