gpt4 book ai didi

css - 为什么我的 HTML5 代码不起作用?

转载 作者:行者123 更新时间:2023-11-28 15:43:48 25 4
gpt4 key购买 nike

感谢所有帮助的人,已经解决了!! :D只是想知道为什么我的代码不起作用?在导航栏下我的段落不会显示?另外,我如何将导航栏全部放在一行上?抱歉,如果这真的很愚蠢,我是新手!

新的更新代码仍然不会在底部显示段落。

 <!DOCTYPE html>
<html>

<head>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<title> Home </title>
</head>

<body>

<img src="Andora ski trip.JPG" alt="View from flat in Andora" height="400" width="100%">


<h1> Home </h1>

<nav>
<ul>
<li><a href="Home.html">Home</a></li>
<li><a href="Curriculum vitae.html">Curriculum vitae</a></li>
<li><a href="literature review.html">Literature review</a></li>
<li><a href="Video.html">Video</a></li>
</ul>
</nav>

<p>My name is Jack Hay and this is the first proper website that i have designed. My aim is to show my CV, some coursework that i have done (Literature review), a short self made video and to learn how to use a stylesheet efficiently</p>

</body>
</html>

CSS

 h1{
font-family:"calibri", Times, Serif;
colour: White;
font-size:50px ;
padding:0.1px;
margin:5
}

ul
{
list-style-type: none;
}

ul li
{
display: block;
width: 25%
float: left
}

最佳答案

首先用 li 标签替换 h2 标签。这不是有效的 html。

要将导航放在一行中,您可以在您的 css 中执行以下操作:

ul
{
list-style-type: none;
}

ul li
{
display: inline-block;
}

关于css - 为什么我的 HTML5 代码不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21921024/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com