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>
相关推荐
Yvonne爱编码10 小时前
CSS- 4.3 绝对定位(position: absolute)&学校官网导航栏实例
前端·css·html·html5·hbuilder
Yvonne爱编码1 天前
CSS- 4.1 浮动(Float)
前端·css·html·github·html5·hbuilder
Yvonne爱编码1 天前
CSS- 4.2 相对定位(position: relative)
前端·css·状态模式·html5·hbuilder
高建伟-joe1 天前
内容安全:使用开源框架Caffe实现上传图片进行敏感内容识别
人工智能·python·深度学习·flask·开源·html5·caffe
源码方舟1 天前
【HTML5】【AJAX的几种封装方法详解】
ajax·okhttp·html5
Alice-YUE2 天前
【HTML5学习笔记1】html标签(上)
前端·笔记·学习·html·html5
Alice-YUE2 天前
【HTML5学习笔记2】html标签(下)
前端·笔记·html·html5
Yvonne爱编码3 天前
CSS- 2.1 实战之图文混排、表格、表单
前端·css·html·github·状态模式·html5·hbuilder
Yvonne爱编码3 天前
CSS- 1.1 css选择器
前端·css·状态模式·html5·hbuilder