html代码块
html<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>示例</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
margin: 0;
padding: 0;
}
.container {
width: 80%;
margin: 20px auto;
background-color: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
color: #333;
}
p {
color: #666;
line-height: 1.6;
}
</style>
</head>
<body>
<div class="container">
<h1>Hello, World!</h1>
<p>This is a simple HTML code block example.</p>
</div>
</body>
</html>
这是一个包含基本HTML结构的示例。它包括了一个标题和一个段落。此外,它还包括了一些简单的CSS样式来美化页面的外观。
链接和图片: 可以在页面中添加超链接和图片元素,让页面更加丰富。
html<a href="https://www.example.com">Visit Example Website</a>
<img src="image.jpg" alt="Example Image">
表格: 可以使用HTML表格元素来展示数据。
html<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>John</td>
<td>25</td>
</tr>
<tr>
<td>Jane</td>
<td>30</td>
</tr>
</table>
表单: 可以添加表单元素,例如文本输入框、复选框、单选框等,用于与用户交互。
html<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name"><br><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email"><br><br>
<input type="submit" value="Submit">
</form>
多媒体: 可以嵌入音频或视频。
html<audio controls>
<source src="audio.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<video controls>
<source src="video.mp4" type="video/mp4">
Your browser does not support the video element.
</video>
这些是一些可以