html再刷
-
标题
HTML 标题是通过<h1>
到<h6>
标签来定义的 -
段落
HTML 段落是通过标签<p>
来定义的. -
链接
HTML 链接是通过标签<a>
来定义的.
<a href="http://www.runoob.com/" target="_blank">访问菜鸟教程!</a>
新窗口打开
<a href="#tips">访问有用的提示部分</a>
<a id="tips">有用的提示部分</a>
跳转到id处 -
图像
HTML 图像是通过标签<img>
来定义的.<img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">
<map name="planetmap">
<area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm">
<area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm">
<area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm"></map><map>
定义图像地图
<area>
定义图像地图中的可点击区域- coords规定区域的坐标。x1,y1,x2,y2 如果 shape 属性设置为 "rect",则该值规定矩形左上角和右下角的坐标。x,y,radius 如果 shape 属性设置为 "circ",则该值规定圆心的坐标和半径。
- href规定区域的目标 URL。
- shape规定区域的形状
-
换行
<br>
-
属性
在标签内添加属性- style 直接在标签内使用样式
<p style="color: brown;text-align: center">在标签内添加属性</p>
- class class 属性可以多用 class=" " (引号里面可以填入多个class属性)
- id 都是添加标记,与css连接 id 属性只能单独设置 id=" "(只能填写一个,多个无效)
- style 直接在标签内使用样式
-
注释
`````` -
水平线
<hr>
-
文本格式化
<b>、<strong>
<i> <em>
<big> <small>
<sup> <sub>
<del>
<abbr>
定义缩写
<pre>
-
头部
在 <head>元素中可以插入脚本(scripts), 样式文件(CSS),及各种meta信息
<title>, <style>, <meta>, <link>, <script>, <noscript>, and <base>
<link>
标签通常用于链接到样式表:<link rel="stylesheet" type="text/css" href="mystyle.css">
<style>
元素中可以直接添加样式来渲染 HTML<style type="text/css">body {background-color:yellow}p {color:blue}</style>
外部引用js<script src="myScript.js"></script>
内部写<script>document.write("Hello World!")</script>
为搜索引擎定义关键词:<meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript">
为网页定义描述内容:<meta name="description" content="免费 Web & 编程 教程">
定义网页作者:<meta name="author" content="Runoob">
每30秒钟刷新当前页面:<meta http-equiv="refresh" content="30">
-
使用css
- 内联样式- 在HTML元素中使用"style" 属性
- 内部样式表 -在HTML文档头部
<head>
区域使用<style>
元素 来包含CSS - 外部引用 - 使用外部 CSS 文件
-
表格
表格由<table>
标签来定义<table> </table>
属性border规定表格单元是否拥有边框1或0
cellpadding 规定单元边沿与其内容之间的空白 cellspacing 规定单元格之间的空白。
每个表格均有若干行<tr>
数据单元格的内容<td>
指表格数据
表格的表头使用<th>
标签进行定义。
跨行<th rowspan="2">Telephone:</th>
跨列<th colspan="2">Telephone</th>
-
列表
-
无序列表
<ul>
<li>Coffee</li>
<li>Milk</li>
</ul>
-
有序列表
<ol>
<li>Coffee</li>
<li>Milk</li>
</ol>
不同类型有序列表
-
<h4>编号列表:</h4>
<ol>
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ol>
<h4>大写字母列表:</h4>
<ol type="A">
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ol>
<h4>小写字母列表:</h4>
<ol type="a">
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ol>
<h4>罗马数字列表:</h4>
<ol type="I">
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ol>
<h4>小写罗马数字列表:</h4>
<ol type="i">
<li>Apples</li>
<li>Bananas</li>
<li>Lemons</li>
<li>Oranges</li>
</ol>
嵌套列表
<h4>嵌套列表:</h4>
<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
</li>
<li>Milk</li>
</ul>
-
区块
块级元素<h1>, <p>, <ul>, <table>
内联元素<b>, <td>, <a>, <img>
<div>
元素组合其他 HTML 元素的容器
<span>
元素是内联元素,可用作文本的容器 -
表单
<form>
定义供用户输入的表单
<input>
定义输入域
<textarea>
定义文本域 (一个多行的输入控件)
<label>
定义了<input>
元素的标签,一般为输入标题
<fieldset>
定义了一组相关的表单元素,并使用外框包含起来
<legend>
定义了<fieldset>
元素的标题
<select>
定义了下拉选项列表
<optgroup>
定义选项组
<option>
定义下拉列表中的选项
<button>
定义一个点击按钮<form action="demo_form.php" method="post/get">
<h4>文本域</h4>
<input type="text" name="email" size="40" maxlength="50">
<h4>密码</h4>
<input type="password">
<h4>复选框</h4>
<input type="checkbox" checked="checked">
<h4>单选框</h4>
<input type="radio" checked="checked">
<h4>提交按钮</h4>
<input type="submit" value="Send">
<h4>重置</h4>
<input type="reset">
<input type="hidden">
<select>
<option>苹果</option>
<option selected="selected">香蕉</option>
<option>樱桃</option>
</select>
<textarea name="comment" rows="10" cols="20"></textarea>
</form>