http(tables,links,lmages,forms/input)
基本格式
<!DOCTYPE html>
<html>
<head>
<title>文档标题</title>
</head>
<body>
<h1>这是一个标题</h1>
<h2>这是一个标题</h2>
<h3>这是一个标题</h3>
<p>这是一个段落。</p>
<p>这是另外一个段落。</p>
<a href="https://www.runoob.com">这是一个链接</a>
<img loading="lazy" src="/images/logo.png" width="258" height="39" />
</body>
</html>
链接(links)
<a href="URL">链接文本</a>
普通链接:<a href="http://www.baidu.com/">链接文字</a>
图像链接:<a href="http://www.baidu.com/"><img src="URL" alt=“替换文本"></a>
邮件链接:<a href="mailto:webmaster@example.com">发送</a>
书签:
<a id="tips">提示部分</a>
<a href="#tips">跳到提示部分</a>
target 属性 使用 target 属性,你可以定义被链接的文档在何处显示。
下面的这行会在新窗口打开文档
<a href="https://www.baidu.com/" target="_blank" rel="noopener noreferrer">文本</a>
id 属性
id属性可用于创建在一个HTML文档书签标记。
提示: 书签是不以任何特殊的方式显示,在HTML文档中是不显示的,所以对于读者来说是隐藏的。
在HTML文档中插入ID:
<a id="tips">有用的提示部分</a>
在HTML文档中创建一个链接到"有用的提示部分(id="tips")":
<a href="#tips">访问有用的提示部分</a>
或者,从另一个页面创建一个链接到"有用的提示部分(id="tips")":
<a href="https://www.runoob.com/html/html-links.html#tips">
访问有用的提示部分</a>
访问有用的提示部分</a>
图片(Images)
<img loadingj="lazy" src="URL" alt="替换文本" height="42" width="42">
表格(Tables)
<table border="1">
<tr>
<th>表格标题</th>
<th>表格标题</th>
</tr>
<tr>
<td>表格数据</td>
<td>表格数据</td>
</tr>
</table>
表单(Forms)
input
type="" password(密码)
checkbox(复选框)
radio(单选按钮)
submit(提交按钮)
reset(重置表单值)
hidden(隐藏)
text(文本)
浙公网安备 33010602011771号