HTML基本结构
<!doctype html>//声明文本类型
<html>//根标签
<title></title>//标题标签
</head>//头标签
<body>//主体标签
</body>
</html>
标签
单标签
注释标签:ctrl+/
换行标签:
br/
水平线标签:hr/
双标签
文本内容
--——上下自动生成空白行 br/不会标题标签:
h1只能在一个页面出现一次
h2
h3
h4
h5
h6:取值到h6
文本标签:font文本格式化标签:strong b
文本倾斜标签:em i
删除线标签:del s
下划线标签:ins u
图片标签
img src="图片来源" alt="图片不显示时显示的文字" title="鼠标放到图片上显示的文字" width="图片宽度" height="图片高度"/——图片没有定义宽高时按100%显示,只改变宽高,等比例缩放。音乐标签
embed src="" hidden="ture"超链接
a href="去往的路径" title="提示文本" target="_self(默认值;在自身页面打开)/_blank(打开新页面)"//锚链接
<p id="top">
<a herf="#top">回到顶部</a>
===========================================
//空链
herf="#"
===========================================
//超链接优化写法:让所有的超链接都在新窗口打开
<head>
<base taeget="_blank">
</head>
列表
//有序列表
<ul type="">//square,disc,circle
<li></li>
</ul>
//有序列表
<ol type="" start="决定起始位置">//1,a,A,i,I
<li></li>
</ol>
//自定义列表
<dl>
<dt>小标题</dt>
<dd>解释标题</dd>
</dl>
滚动
meta/link标签
//关键字——搜索引擎关键字
<meta name="keywoeds" content="标签1,标签2">
============================================
//网页描述
<meta name="description" content="搜索出来的简介">
============================================
//网页重定向
<meta http-equiv="refresh" content="重载网站">
============================================
//链接外部样式表文件
<link rel="stylrsheet" href="1.css">
============================================
//设置icon图标
<link rel="icon" href="favicon.ico">
表格
<table border="边框宽度" width="" height="" cellspacing="单元格之间的距离" cellpadding="内容到边框的距离" bgcolor="背景颜色">
<tr>
<td align="right">1.1</td>
<td>1.2</td>
</tr>
<tr>
<td>2.1</td>
</tr>
</table>
1.1 | 1.2 |
2.1 |
标准结构
<table>
<thead>
<tr>
<td align="right">1.1</td>
<td>1.2</td>
</tr>
</thead>
<tbody>
<tr>
<td>2.1</td>
</tr>
</tbody>
</table>
表单
表单的作用是收集信息<form action="1.php" method="get">
//get 通过地址栏提供传输信息 post通过1.php
来处理,安全性更高
<input type="text" maxlength="最长字符长度" readonly="readonly" disabled="disabled" name="所读取数据的名称" value=“默认值,将值传给处理文件”>
========================================================
密码输入框 ········
<input type="password">
========================================================
单选
<input type="radio" name="gender(单选)" checked="checked(默认选中项)">
=========================================================
下拉列表
<select Multiple="mutiple(多选)">
<option>下拉列表选项</option>
<option selected="selected(默认选项)">下拉列表选项</option>
</select>
==========================================================
下拉列表分组
<select>
<optgroup label="分组名称">
<option>1</option>
</optgroup>
===========================================================
多选框
<input type="checkbox">x
多行文本框
<textarea cols="输入字符的长度" rows="输入行数">
===========================================================
文件上传控件
<input type="file">
===========================================================
文件提交按钮
<input type="submit">
===========================================================
普通按钮
<input type="button" value="x">
===========================================================
图片按钮
<input type="image" src="x.jpg">
===========================================================
重置按钮
<input type="reset">
===========================================================
表单信息分组
<fieldset>
<legend></legend>
</fieldset>