国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > HTML > 正文

HTML框架標簽的實例應用

2020-03-24 18:40:58
字體:
來源:轉載
供稿:網友
1.HTML中主要的基礎標簽如下:

注釋標簽 !-- -- ;

段落標簽 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.垂直框架結構,將頁面垂直分為三個部分。

目錄結構如圖:

1496815981(1).jpg

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 

運行結果圖

1.jpg

例2.混合結構框架。

目錄結構如圖:

2.jpg

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 

運行結果圖

3.jpg

以上就是HTML框架標簽的實例應用的詳細內容,html教程

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 习水县| 临沂市| 镇赉县| 雷波县| 克东县| 潮安县| 呼玛县| 微博| 渑池县| 宜州市| 江华| 太湖县| 磐安县| 民县| 驻马店市| 乌鲁木齐市| 芮城县| 苏尼特左旗| 法库县| 自贡市| 郸城县| 玉屏| 阿合奇县| 综艺| 盈江县| 沛县| 东兰县| 萨迦县| 饶阳县| 乡宁县| 利川市| 蒙阴县| 山东省| 章丘市| 富裕县| 仙游县| 香格里拉县| 青河县| 开原市| 新绛县| 道孚县|