<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Index Page</title>
</head>
<body>
<header>
<h1>Welcome to My Website</h1>
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#services">Services</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</header>
<main>
<section id="home">
<h2>Home</h2>
<p>This is the home section of the website.</p>
</section>
<section id="about">
<h2>About</h2>
<p>This is the about section of the website.</p>
</section>
<section id="services">
<h2>Services</h2>
<p>This is the services section of the website.</p>
</section>
<section id="contact">
<h2>Contact</h2>
<p>This is the contact section of the website.</p>
</section>
</main>
<footer>
<p>© 2023 My Website. All rights reserved.</p>
</footer>
</body>
</html>
<!DOCTYPE html> 声明文档类型为HTML5。<html lang="en"> 定义整个文档的语言为英语。<meta charset="UTF-8"> 设置字符编码为UTF-8,确保网页可以正确显示各种语言的字符。<meta name="viewport" content="width=device-width, initial-scale=1.0"> 确保网页在移动设备上能够正确缩放和布局。<title> 标签定义了浏览器标签中显示的标题。<header> 包含页面的顶部内容,如标题和导航栏。<nav> 定义了导航链接。<main> 包含页面的主要内容,分为多个部分(<section>),每个部分有自己的标题和描述。<footer> 包含页面底部的信息,如版权声明。这个示例代码展示了一个基本的HTML页面结构,适合用作网站的首页。
上一篇:html下划线
下一篇:html5中validate
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站