查找更多博客here
嘿,有抱负的网络开发人员!从HTML开始寻找方便的作弊表?别再看!以下是一些基本HTML标签和元素的综合指南,可以帮助您建立网页的基础。让我们开始吧! ð7»
结构
这是启动您的Web项目的标准HTML样板代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Document</title>
</head>
<body></body>
</html>
标题
HTML提供六个级别的标题,从H1(最大)到H6(最小):
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
容器
容器标签用于分组内容。常用的容器标签是:
<div>This is a div block</div>
<span>This is a span block</span>
<p>This is a paragraph</p>
<pre>Hello World</pre>
<code>import python</code>
文本格式
使用文本格式标签强调或样式文本:
<b>I'm bold text</b>
<strong>I'm important text</strong>
<i>I'm italic text</i>
<em>Emphasized text</em>
<sub>Subscript</sub>
<sup>Superscript</sup>
列表
创建有序和无序的列表:
<ol>
<li>Data 1</li>
<li>Data 2</li>
<li>Data 3</li>
</ol>
<ul>
<li>Your Data</li>
<li>Your Data</li>
</ul>
媒体
将图像,音频和视频嵌入到您的网页中:
<audio controls>
<source src="demo.mp3" type="audio/mpeg" />
Your browser does not support the audio element.
</audio>
<img src="Source_of_image" alt="Alternate text" />
<video width="480" height="320" controls>
<source src="demo_move.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
桌子
以表格格式呈现数据:
<table>
<caption>
Demo Table
</caption>
<thead>
<tr>
<th>Column1</th>
<th colspan="2">Column2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Data1</td>
<td>Data2</td>
<td>Data2</td>
</tr>
<tr>
<td>Data1</td>
<td>Data2</td>
<td>Data2</td>
</tr>
</tbody>
<tfoot>
<tr>
<td> </td>
<td>Data</td>
<td>Data</td>
</tr>
</tfoot>
</table>
链接
创建超链接以在页面之间导航:
<a href="https://preetsuthar.me/">Visit preetsuthar portfolio!</a>
形式
使用HTML表格捕获用户输入:
<form action="/action.php" method="post">
Name: <input name="name" type="text" /> <br />
Age: <input max="90" min="1" name="age" step="1" type="number" value="18" />
<br />
<select name="gender">
<option selected="selected" value="male">Male</option>
<option value="female">Female</option></select
><br />
<input checked="checked" name="newsletter" type="radio" value="daily" /> Daily
<input name="newsletter" type="radio" value="weekly" /> Weekly<br />
<textarea cols="20" name="comments" rows="5">Comment</textarea><br />
<label
><input name="terms" type="checkbox" value="tandc" />Accept terms</label
>
<br />
<input type="submit" value="Submit" />
</form>
字符和符号
使用HTML实体显示特殊字符:
©
<!-- Copyright Symbol (©) -->
<
<!-- Less than (<) -->
>
<!-- Greater than (>) -->
&
<!-- Ampersand (&) -->
$
<!-- Dollar ($) -->
随机文字
使用随机文本测试您的布局:
Elon Musk is an entrepreneur and business magnate. He is the founder, CEO, and
Chief Engineer at SpaceX; CEO and Product Architect of Tesla, Inc.; founder of
The Boring Company; and co-founder of Neuralink and OpenAI. A centibillionaire,
Musk is one of the richest people in the world.
语义元素
使用语义元素来更好地HTML结构:
<section>This is a section</section>
<article>Enter your data here</article>
<aside>Your data</aside>
在那里,您有一个方便的HTML作弊表,可以帮助您进行网络开发旅程!通过html.ðð»ð¥
继续练习和建立令人惊奇的事物