Welcome to the HTML tutorial! If you're new to web development, this guide will help you get started with HTML, the standard markup language for creating web pages.
基础标签
Here are some basic HTML tags that you'll use to structure your web pages:
<html>
: The root element that encloses all the content of the HTML document.<head>
: Contains meta-information about the document, such as the title and links to CSS and JavaScript files.<body>
: Contains the content of the document, such as text, images, and links.<title>
: Specifies the title of the document, which appears in the browser's title bar or tab.<h1>
to<h6>
: Defines heading levels, with<h1>
being the highest level.<p>
: Defines a paragraph.
图片
To add an image to your HTML document, use the <img>
tag. Here's an example:
<img src="https://cloud-image.ullrai.com/q/image/" alt="Sample Image"/>
链接
To add a link to your HTML document, use the <a>
tag. Here's an example:
<a href="/en/developer/css-tutorial">Learn CSS</a>
表格
To create a table in HTML, use the <table>
, <tr>
, <th>
, and <td>
tags. Here's an example:
<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Row 1, Cell 1</td>
<td>Row 1, Cell 2</td>
</tr>
<tr>
<td>Row 2, Cell 1</td>
<td>Row 2, Cell 2</td>
</tr>
</table>
列表
To create a list in HTML, use the <ul>
, <ol>
, and <li>
tags. Here's an example:
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
总结
This tutorial has covered the basics of HTML. To learn more, check out our CSS tutorial or JavaScript tutorial. Happy coding! 🌟