5-Javaweb learning -frameset, frame, iframe tags frame
A, frameset
Note frameset tags and body tags can not coexist
1. Properties
①border
Set the frame border thickness.
②bordercolor
Border color frame.
③frameborder
Set to display the frame border. Only the set value 0,1; 0 means you can not frame, 1 frame to be displayed.
④cols
Split lengthwise page. Its value represents three ways: "30% 30 (or 30px), "; number representative of the number of windows and is divided by the value of the value between "," separated. "30%" indicates 30% of the frame region of the entire region of the browser page; "30" represents the lateral width of the pixel region 30; " " indicates that the region occupies the remaining space on the page. For example: cols = "25%, 200 , *" means that the page is divided into three parts, the left part represents 30% of the page, the intermediate transverse width of 200 pixels, as the right part of the remaining pages.
⑤rows
Horizontal fragmentation page. Numerical representation and meaning and the same cols.
⑥framespacing
Set retention blank distance between the frame and the frame.
2. Examples
<frameset cols="213,*" frameborder="no" border="0" framespacing="0">
注意1:
cols与rows两属性尽量不要同在一个<frameset>标签中使用。若要实现下图架构,代码正确写法为:
Frameset使用教程
<frameset rows="59,*" cols="*" frameborder="no" border="0" framespacing="0">
<frame src="???" name="topFrame" scrolling="No" noresize="noresize" id="topFrame"/>
<frameset cols="213,*" frameborder="no" border="0" framespacing="0">
<frame src="???" name="leftFrame" scrolling="No" noresize="noresize" id="leftFrame"/>
<frame src="???" name="mainFrame" id="mainFrame"/>
【即,若想即使用cols又使用rows,可利用frameset嵌套实现】
注意2:
<frameset cols="40%,*,*">
意思是:第一个框架占整个浏览器窗口的40%,剩下的空间平均分配给另外两个框架。
<frameset cols="*,*,*,*">
意思是:浏览器窗口等分为四部分。
Two, frame
1. Properties
①name
Set frame name. This is a property that must be set.
②src
This framework is set to be displayed on the page name or path. This is a property that must be set.
③scrolling
Set whether to display a scroll bar. Setting is auto, yes, no.
④bordercolor
Border color frame.
⑤frameborder
Set to display the frame border. Only the set value 0,1; 0 means you can not frame, 1 frame to be displayed.
⑥noresize
Whether to set the frame size can be manually adjusted.
⑦marginwidth
Setting the width between the boundary frame and its contents.
⑧marginhight
Setting the boundary between the frame and the height of its contents.
⑨width
Setting the frame width.
⑩height
Set the frame height.
2. Examples
<frame src="???" name="topFrame" scrolling="No" noresize="noresize" marginwidth="10" marginhight="10" width="400" height="800" />
Three, iframe
A floating frame (frame), which is similar to frame common attributes and other mainly in the following (the same is not listed)
1. Properties
①align
Set the vertical or horizontal alignment
②allowTransparency
Gets or sets whether the object is transparent.
2. Examples
<iframe name="123" align="middle" marginwidth="0" marginheight=0 src="???" frameborder="0" scrolling="no" width="776" height="2500"></iframe>
注意:
iframe标签与frameset、frame标签的验证方法不同,是XHTML 1.0 Transitional。且iframe是放在body标签之内,而frameset、frame是放在body标签之外。