创建一个简单的HTML文档:
<!DOCTYPE html>
声明。<html>
标签,并设置lang
属性为英语。<head>
标签,其中包含<meta charset="UTF-8">
和一个自定义的页面标题。<body>
标签,其中包含一个标题标签?<h1>
?和一个段落标签?<p>
。创建一个有序列表和无序列表:
设计一个简单的表格:
创建一个链接到外部网页的超链接:
添加一张图片到你的页面:
<img>
标签。创建一个简单的表单:
使用注释注解你的HTML代码:
答案:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First HTML Page</title>
</head>
<body>
<h1>Welcome to My Page</h1>
<p>This is a simple HTML page.</p>
</body>
</html>
<!-- 无序列表 -->
<ul>
<li>Hiking</li>
<li>Reading</li>
<li>Coding</li>
</ul>
<!-- 有序列表 -->
<ol>
<li>Math</li>
<li>History</li>
<li>Science</li>
</ol>
<table border="1">
<thead>
<tr>
<th>Name</th>
<th>Age</th>
<th>City</th>
</tr>
</thead>
<tbody>
<tr>
<td>Your Name</td>
<td>Your Age</td>
<td>Your City</td>
</tr>
<tr>
<td>Fictional Person</td>
<td>30</td>
<td>Fictional City</td>
</tr>
</tbody>
</table>
<a href="https://www.example.com">Example Website</a>
<img src="image.jpg" alt="Description of the image">
<form>
<label for="username">Username:</label>
<input type="text" id="username" name="username" required><br><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required><br><br>
<input type="submit" value="Submit">
</form>
<!-- This is a simple HTML document -->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Metadata for character set and title -->
<meta charset="UTF-8">
<title>My First HTML Page</title>
</head>
<body>
<!-- Main content -->
<h1>Welcome to My Page</h1>
<p>This is a simple HTML page.</p>
<!-- Lists, tables, links, images, and form -->
<ul>
<!-- Unordered list -->
<li>Hiking</li>
<li>Reading</li>
<li>Coding</li>
</ul>
<!-- ... -->
</body>
</html>