`

HTML 2 常用标签

阅读更多
一,格式标签
1,<hr>标签 :分隔线
width设置为%的方式,会随着浏览器的缩小放大而变化,固定宽度不会随着浏览器的变化而变化

2,<ul> 无序列表 里面嵌套<li>

3, <ol> 有序列表 里面嵌套<li>

4,<br/> 换行标签与<p>标签
<br>换行两行之间紧挨着,而<p>换行两行之间有间隔

5,<pre> 按原文显示的标签
  如<pre> aaa   ccc  ddd
       jjj

</pre>
----------------------------------------------------------------------------



二,文本标签
1,<hn> 默认带有换行的n级标题
<h1>  <h2>  <h3>  <h4> <h5> <h6>

便于搜索引擎搜索
2,<b> 字体加粗

3,<i> 斜体标签

4,<u> 下划线

5,<strong> 表示强调,通常为粗体字

6,<em> 表示强调,通常为斜体字

7,<cite> 用于引证举例,通常为斜体字

----------------------------------------------------------------------------------


三,链接标签
1,<a href="">
注意事项,超链接如果链接到外网站,href后面必须加http,否则链接的是内网站
title:鼠标放上链接展示链接详情
target:_blank 新窗口弹出,_self当前页面展示
锚点:
href="#" 跳转当前页面的最上面,
href=""  显示当前目录下的所有文件(不建议使用,不安全)
href="#one" 跳转到当前页面中指定name=“one”的位置
href="index.html#two" 跳转到index.html页面的namme="two'的位置
---------------------------------------------------------------------------


四,图片标签
<img src="" alt="图片说明"  border="0"/>
src:图片的存放路径
border;图片边框
alt:图像的替代文字
-------------------------------------------------------------------------


五,表格标签及常见属性
1,<table>标签
<table  border="1" width="200">
    <caption align="center"><h1>表名称</h1></caption>
  <tr>
   <th>字段名</th>
<th>字段名</th>
<th>字段名</th>
<th>字段名</th>
<th>字段名</th>
   </tr>
   <tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>3</td>
<td>3</td>
   <tr>
   <tr>
<td>4</td>
<td>5</td>
<td>6</td>
<td>3</td>
<td>3</td>
   <tr>
</table>
<caption>标签,定义表格标题
<th>标签,定义表格表头(字段名)

2,常用属性
<td colspan=2><th rowspan=3>
rowspan:跨行
colspan: 跨列
----------------------------------------------------------------------------------


六,框架标签
<frameset rows="100,*" cols="300,*,*">
<frame src="http://www.baidu.com"/>
<frame src="http://www.baidu.com"/>
<frame src="http://www.baidu.com"/>
<frame src="http://www.baidu.com"/>
<frame src="http://www.baidu.com"/>
<frame src="http://www.baidu.com"/>
</frameset>


意义;将一个浏览器窗口分为多个模块
注意:frame框架与body冲突,有frame就不能有body

----------------------------------------------------------------------------------

七,表单
<form action="http/baidu.com/index.html" method="get">
<input type="text" name="username" />
<input type="submit" value="提交"/>
</form>
action:表单提交的路径
method:提交的方法,默认是get,通过浏览器地址栏的方式传递参数,明文显示,提交的内容大小有限
POST;参数是通过http协议传递的,不会在地址栏显示,参数的大小可以在服务器中配置


<input type="text" name="username" size="10" value="wang5" maxlength="5" accesskey="u" tabindex="2">
<input type="password" name="passwd"  maxlength="6" accesskey="p" tabindex="1"/>
size:输入框显示 的长度
value:默认值
maxlength:输入的最大字符数
accesskey:快捷键alt+u获取焦点可以输入字符
tabindex:调整按TAB键获取输入框的顺序,按数值的大小排序

-------------------------------------------------------------------------------


八,HTML的头部应用
<meta name=”viewport” content=”width=240, height=320, user-scalable=yes, initial-scale=2.5, maximum-scale=5.0, minimun-scale=1.0”>
viewport:用于移动设备手机上
<meta  name="keywords" content="关键字搜索"/>
<meta  name="description" content="百度显示的详细信息"/>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<meta http-equiv="Refresh" content="1"/>
http-equiv:通过http协议设置
Content-Type:设置文本类型和字符编码
Refresh:等待多少秒重新刷新页面

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics