HTML5 是HyperText Markup Language 5 的缩写,是一种标记语言。
第一个程序,基本框架。
DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>第一个程序title>
head>
<body>
hello world
body>
html>
DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>表格基本语法title>
head>
<body>
<table align="center" border="1" cellpadding="2" cellspacing="0" width="200" height="100">
<tr>
<th>姓名th> <th>性别th> <th>年龄th>
tr>
<tr><td>刘德华td> <td>男td> <td>56td>tr>
<tr><td>张学友td> <td>男td> <td>58td>tr>
table>
body>
html>
合并表格:
DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>单元格合并title>
head>
<body>
<p>步骤p>
<p>1.确定行和列,跨列colspan、跨行rowsapnp>
<p>2.写代码p>
<p>3.删除多余单元格p>
<table width="500" height="249" border="1" cellspacing="0">
<tr>
<td>td>
<td colspan="2">td>
tr>
<tr>
<td rowspan="2">td>
<td>td>
<td>td>
tr>
<tr>
<td>td>
<td>td>
tr>
table>
body>
html>
无序列表
DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>列表title>
head>
<body>
<h4>你最喜欢吃的食物h4>
<ul>
<li>西瓜li>
<li>火锅li>
<li>菠萝li>
ul>
body>
html>
有序列表
DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>有序列表title>
head>
<body>
<h4>你最喜欢吃的食物h4>
<ol>
<li>西瓜li>
<li>火锅li>
<li>菠萝li>
ol>
body>
html>
自定义列表
DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>自定义列表title>
head>
<body>
<dl>
<dt>关注我们dt>
<dd>新浪微博dd>
<dd>微信邮箱dd>
<dd>联系电话dd>
dl>
body>
html>
DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>表单title>
head>
<body>
<from action="demo.php" method="post" name="name1">
from>
body>
html>
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>input 表单元素title>
head>
<body>
<form action="xxx.php" method="get">
用户名: <input type="text" name="username" value="请输入用户名" maxlength="6"> <br>
密码: <input type="password" name="pwd" > <br>
性别: 男 <input type="radio" name="sex" value="男"> 女 <input type="radio" name="sex" value="女" checked="checked"> 外星人 <input type="radio" name="sex" value="人妖"> <br>
爱好: 吃饭 <input type="checkbox" name="hobby" value="吃饭"> 睡觉 <input type="checkbox" name="hobby"> 打豆豆 <input type="checkbox" name="hobby" checked="checked">
<br>
<input type="submit" value="免费注册">
<input type="reset" value="重新填写">
<input type="button" value="获取短信验证码"> <br>
上传头像: <input type="file" >
form>
body>
html>
DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>labeltitle>
head>
<body>
<label for="username">用户名:label> <input type="text" id="username" /> <br />
性别: <input type="radio" name="sex" id="male" value="male" /> <label for="male">男label>
<input type="radio" name="sex" id="female" value="female" /><label for="female">女label>
body>
html>
DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>12.select下拉选择标签title>
head>
<body>
喜欢的城市:<select>
<option value="重庆">重庆option>
<option selected="selected" value="湖南">湖南option>
<option value="深圳">深圳option>
select>
body>
html>
DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>13.textarea文本域标签title>
head>
<body>
今日心得:<textarea name="xinde" id="xinde" cols="30" rows="10">2022年4月17日,天气阴。好好学习,天天向上。textarea>
body>
html>