使用 CSS 更改默认显示值

cssweb developmentfront end technology更新于 2024/10/18 17:48:17

CSS 中的每个元素都有一个默认显示值,我们可以轻松更改。这可以通过显式设置 display 属性值来实现。让我们看一个示例,其中我们为水平菜单设置内联显示属性值。 −

示例

<!DOCTYPE html>
<html>
<head>
<style>
p {
   background-color: orange;
   color: white;
}
li {
   display: inline;
}
</style>
</head>
<body>
<h2>Tutorials List</h2>
<p>Following are the list of resources:</p>
<ul>
<li><a href="https://www.cainiaomax.com/machine_learning/index.htm" target="_blank">Machine Learning</a></li>
<li><a href="https://www.cainiaomax.com/python_data_science/index.htm" target="_blank">Python Data Science</a></li>
<li><a href="https://www.cainiaomax.com/python/index.htm" target="_blank">Python</a></li>
<li><a href="https://www.cainiaomax.com/csharp/index.htm">C#</a></li>
<li><a href="https://www.cainiaomax.com/artificial_intelligence/index.htm" target="_blank">Artificial Intelligence</a></li>
</ul>
</body>
</html>

输出


相关文章


有用资源