注釋標簽 !-- -- ;
段落標簽 p /p ;
標題標簽 h1 /h1 ,該標簽的參數從h1~h6;
換行標簽 br/ 或者 br ;
(字體)粗體標簽 b /b ;
(字體)斜體標簽 i /i ;
下標 sub /sub ;
上標 sup /sup ;
預格式標簽 pre /pre ;
地址標簽 address /address ;
刪除標簽 del /del ;
插入標簽 ins /ins ;
連接標簽 a /a ;
下水平線標簽 hr/ ;
2.連接標簽的語法: a href=連接地址 名字 /a
例如,要想連接到百度首頁:
[html] view plain copy
a href= http://www.baidu.cn 百度 /a
將圖片作為按鈕連接到指定路徑,其中alt為移動鼠標顯示的名字,src為圖片的路徑:
[html] view plain copy
a href= http://www.baidu.cn img alt= 百度 src= smile.png
/a
在新的瀏覽器打開連接:
[html] view plain copy
a href= http://www.baidu.cn target= _blank 百度
/a
跳轉到當前頁面的指定段落:
[html] view plain copy
/a
a href= #a3 跳轉 /a
p
a name= a1 段落a1 /a
/p
p
a name= a1 段落a1 /a
/p
p
a name= a1 段落a1 /a
/p
3.HTML中的框架結構
例1.垂直框架結構,將頁面垂直分為三個部分。
目錄結構如圖:
f1.html代碼
!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd html head meta http-equiv= Content-Type content= text/html; charset=UTF-8 title Insert title here /title /head body 最左邊框架 /body /html
f2.html代碼
!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd html head meta http-equiv= Content-Type content= text/html; charset=UTF-8 title Insert title here /title /head body 中間框架 /body /html
f3.html代碼
!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd html head meta http-equiv= Content-Type content= text/html; charset=UTF-8 title Insert title here /title /head body 最右邊框架 /body /html
frame.html代碼
!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd html head meta http-equiv= Content-Type content= text/html; charset=UTF-8 title 框架結構 /title !-- 框架結構,frameset不需要寫在body里面 -- /head !-- 垂直結構框架用cols,水平框架用rows -- frameset cols= 30%,40%,30% frame src= f1.html frame src= f2.html frame src= f3.html /frameset /html
運行結果圖
例2.混合結構框架。
目錄結構如圖:
f1.html代碼
!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd html head meta http-equiv= Content-Type content= text/html; charset=UTF-8 title Insert title here /title /head body h1 這是一個導航框架 /h1 /body /html
f2.html代碼
!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd html head meta http-equiv= Content-Type content= text/html; charset=UTF-8 title Insert title here /title /head body p 菜單 /p !-- 單擊菜單一跳轉到menu1.html頁面,并將該頁面在menu框架里面打開 -- a href= menu1.html target= menu 菜單一 /a a href= menu2.html target= menu 菜單二 /a /body /html
f3.html代碼
!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd html head meta http-equiv= Content-Type content= text/html; charset=UTF-8 title Insert title here /title /head body 菜單內容 /body /html menu1.html代碼[html] view plain copy !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd html head meta http-equiv= Content-Type content= text/html; charset=UTF-8 title Insert title here /title /head body 我是菜單一的內容 /body /html
menu2.html代碼
!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd html head meta http-equiv= Content-Type content= text/html; charset=UTF-8 title Insert title here /title /head body 我是菜單二的內容 /body /html
frame.html代碼
!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd html head meta http-equiv= Content-Type content= text/html; charset=UTF-8 title 混合框架結構 /title /head !-- 最開始為水平框架 -- frameset rows= 20%,* !-- 水平框架里面最開始是一個frame和另一個垂直框架 -- !-- noresize= noresize 屬性限制框架大小,設置為固定值 -- frame src= f1.html noresize= noresize frameset cols= 20%,* !-- 垂直框架里面有兩個frame -- !-- 該框架為菜單,單擊內容可以跳轉頁面 -- frame src= f2.html noresize= noresize !-- 將該框架命名為menu -- frame src= f3.html noresize= noresize name= menu /frameset /frameset /body /html
運行結果圖
鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。
新聞熱點
疑難解答