超链接
target =
- _blank 在新窗口中打开链接
- _parent 在父窗体中打开链接
- _self 在当前窗体打开链接,此为默认值
- _top 在当前窗体打开链接,并替换当前的整个窗体(框架页)
图片链接
<a href="网址"><img border="数字"/*图片边框*/ src="图片地址" alt="网页关键字"/*规定在图像无法显示时的替代文本*/ width="32" height="32"></a>
HTML样式
用style更改颜色
<style type="text/css">
h1 {color:grey;}
p {color:blue;}
用style做没有下划线的链接
<a href="//www.runoob.com/" style="text-decoration:none;">
//text-decoration:表示下划线
-
style="color:blue;margin-left:20px;"//左边距20px style="background-color:yellow;"//背景色属性 font-family(字体),color(颜色),和font-size(字体大小) style="text-align:center;"居中对齐
表格
//border 是边框粗细 表格内容 /*一行*/表头 |
---|
<table border = "1">//border 是边框粗细
<tr>
<caption>标题</caption>
<th>表头</th>
<tb>表格内容 </tb>
</tr>/*一行*/
</table>
单元格跨列
单元格跨行
有单元格边距:
//
序号标签
<ol>
<li>内容<li>
</ol>
<ol start="50">
//序号从50开始
<li>内容<li>
</ol>
[div]和[span]
div标签就是一个个模块,相当于容器。一般和css class 一起用,用来设计样式。
span没有语义,用于做样式
表单
单选
复选
下拉列表
Volvo<select name="cars">
<option value="volvo">Volvo</option>
</select>
文本域
<textarea rows="10" cols="30">
我是一个文本框。
</textarea>
创建按钮
<input type="button" value="按钮名字">