html5

基础结构

html 复制代码
<!--声明为html5-->
<!DOCTYPE html>
<html>
<head>
    <!--设置编码方式-->
    <meta charset="UTF-8">
    <!--移动端设置-->
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0">
    <title>base</title>
    <!--引入外部资源-->
    <link rel="stylesheet" href="../css/main.css">
    <script src="../css/main.js"></script>
</head>
<body>
<!--内容区-->
<form></form>
<!--脚本区-->
<script></script>
</body>
</html>

块级标签:独占一行

html 复制代码
<div>div</div>
<p>段落一</p>
<h1>一级标题</h1>
<h6>六级标题</h6>
<ol>有序列表
    <li>项目一</li>
    <li>项目二</li>
</ol>
<ul>无序列表
    <li>项目一</li>
    <li>项目二</li>
</ul>
<dl>自定义列表
    <dt>列表一</dt>
    <dd>dd1</dd>
    <dd>dd2</dd>
    <dt>列表二</dt>
    <dd>dd3</dd>
    <dd>dd4</dd>
</dl>

行内标签:不能独占一行,不能设置宽高属性

html 复制代码
<a href="http://www.baidu.com">百度</a>
<span>span1</span>
<strong>strong1</strong>

行内块级标签:不能独占一行,可以设置宽高属性

html 复制代码
<br/>
<imgsrc="../img/demo.jpg" height="108" width="192"/>
<input>

块级标签与行内标签转换

html 复制代码
<div style="display: inline">块级转行内</div>
<span style="display: block">行内转块级</span>

表单标签

html 复制代码
<form action="" method="post"/>
    <input type="password"/>
    <input type="submit"/>
    <input type="button"/>
    <input type="date"/>
    <input type="reset"/>
    <input type="checkbox"/>
    <input type="radio"/>
    <select>
        <option></option>
    </select>
</form>

新表单标签

html 复制代码
<form id="form2">
	<input type="email"/>
	<input type="url"/>
	<input type="number" value="0" step="10"/>
	<input type="range"/>
	<input type="datetime-local"/>
	<input type="search"/>
	<input type="color"/>
	<input type="text" placeholder="姓名"/>
	<input type="submit" form="form2"></button>
</form>

表格标签

html 复制代码
<table border="1px" cellspacing="0px" cellpadding="10px">
    <tr>
        <td>td1</td>
        <td>td2</td>
    </tr>
    <tr>
        <td colspan="2">td3</td>
    </tr>
</table>

多媒体标签

html 复制代码
<!--音频-->
<audio controls>
	<source src="../static/demo.mp4">
</audio>
<!--视频-->
<video muted controls style="width: 500px;height: 300px;">
	<source src="../static/demo.mp4">
</video>
相关推荐
涔溪17 小时前
HTML5 实现的圣诞主题网站源码,使用了 HTML5 和 CSS3 技术,界面美观、节日氛围浓厚。
css3·html5·节日
Amy.Wang1 天前
前端如何实现电子签名
前端·javascript·html5
veminhe1 天前
html怎么设置html5
html·html5
失落的多巴胺2 天前
使用deepseek制作“喝什么奶茶”随机抽签小网页
javascript·css·css3·html5
veminhe12 天前
HTML5 浏览器支持
前端·html·html5
伍哥的传说12 天前
react gsap动画库使用详解之text文本动画
前端·vue.js·react.js·前端框架·vue·html5·动画
veminhe13 天前
HTML5简介
前端·html·html5
蹦极的考拉17 天前
在使用 HTML5 的 <video> 标签嵌入视频时,有时会遇到无法播放 MP4 文件的问题
前端·音视频·html5
木木黄木木17 天前
HTML5 火焰字体效果教程
前端·html·html5
于本淡17 天前
一篇文章快速学会HTML
开发语言·前端·数据结构·qt·html·json·html5