本文共 3066 字,大约阅读时间需要 10 分钟。
html文档所有头部元素的容器,里面的元素用来描述html文档的相关信息,如指定网页标题,编码方式,指定浏览器在何处找到css样式表等,这些信息大部分用于提供索引,辨认页面属性或用于其他方面,不会在浏览器中显示。
定义文档的元数据,如字符编码,作者版权,关键字和网页说明等。
水平线
换行
无序列表
<ul type=""> <li>咖啡</li> <li>牛奶</li> <li>奶茶</li></ul>有序列表<ol type=""> <li>咖啡</li> <li>牛奶</li> <li>奶茶</li></ol>定义列表<dl> <dt>咖啡</dt> <dd>黑色的热饮</dd> <dt>牛奶</dt> <dd>白色的冷饮</dd></dl><img src="文件路径" width="宽度" height="高度" title="图像名称" alt="替代文本"/>
/base专门用来统一当前网页的超链接打开方式/
<base target="_self">超链接的分类:文字超链接,图像超链接,锚点超链接,邮件超链接//属性:download//值:filename指定下载链接<a href="跳转文件的路径" target="窗口打开方式">文本或图片</a>文字超链接:<a href="跳转文件的地址">链接文字</a>图像超链接:<a href="跳转文件的地址"><img src="" /></a>邮件超链接:<a href="mailto:邮箱地址">链接文字</a>锚点超链接:链接文字 | 第一步骤:定位标记 | 第二步骤:建立链接 |
---|---|---|
链接文字一 | <a name="m1">欲跳转的位置</a> | <a href="#m1">链接文字一</a> |
链接文字二 | <a name="m2">欲跳转的位置</a> | <a href="#m2">链接文字二</a> |
链接文字三 | <a name="m3">欲跳转的位置</a> | <a href="#m3">链接文字三</a> |
/描点(页面内跳转)/
<a href="#top">顶部</a><a href="#center">中部</a><a href="#bottom">底部</a><h2 id="top">顶部</h2><h2 id="center">中部</h2><h2 id="bottom">底部</h2>target属性值:target ="blank" | 保存当前窗口,在新窗口中打开链接的网页 |
---|---|
target="parent" | 在当前窗口打开链接的网页,如果时框架网页,则在父框架中显示打开的链接网页 |
target="self"(默认) | 在当前窗口打开链接的网页,如果时框架网页,则在当前框架中显示打开的链接网页 |
target="top" | 在当前窗口打开链接的网页,如果时框架网页,则删除所有框架,显示打开的网页 |
水平对齐和垂直对齐的属性align=left/right,center,valign=top/center/bottom,
其中水平对齐可以给table和tr,td使用.垂直对齐只能给tr,td使用.外边距和内边距的属性cellspacing(默认是2px),cellpadding(默认是1px),外边距就是单元格和单元格之间的距离,内边距就是内容和单元格边框之间的距离,只能给table使用.table标签设置align属性,可以控制表格在水平方向的对齐方式,不能在垂直方向。给tr设置align属性,可以控制当前行中所有单元格内容的水平方向上的对齐方式。给td设置align属性,可以控制当前单元格中内容在水平方向的对齐方式。如果td设置了align属性,tr中也设置了aling属性,那么单元格中的内容会按照td中设置的来对齐。水平合并colspan对td标签,垂直合并rowspan对td标签.<table border="1" cellpadding="" cellspacing="" align> <caption></caption> <thead> <tr> <th></table>
<form action="" method="post">
<fieldset><legend></legend><label for="account"></label><input type="text" value="user" id="account"/><input type="password" value="123"/><input type="radio" name="sex" checked="checked"/><input type="checkbox" checked="checked"/><input type="button" value="按钮"/><input type="image" src="baidu.png"/><input type="reset" value="清空"/><input type="submit"/><input type="email"/><input type="file" value=""/><input type="url"/><input type="number"/><input type="date"/><input type="color"/><input type="hidden"/>配合提交按钮<label for="acount">账号:</label><input type="text" id="acount"/><label for="password">密码:</label><input type="password" id="password"/>/输入框待选项/<input type="text" list="cars"><datalist id="cars"><option></option></datalist>/下拉列表/<select><optgroup label="北京"><option selected="selected">朝阳区</option><option>昌平区</option><option>通州区</option></optgroup><optgroup label="广州"><option>天河区</option><option>越秀区</option><option>黄浦区</option></optgroup></select>/多行输入框textarea/<textarea cols="2" rows="2">内容</textarea>默认情况下有输入框自己的宽度和高度</fieldset></form>转载于:https://blog.51cto.com/12364813/2120746