Html5

16
HTML (Frames)

description

HTML5 will be the new standard for HTML, XHTML, and the HTML DOM.The previous version of HTML came in 1999. The web has changed a lot since then.HTML5 is still a work in progress. However, most modern browsers have some HTML5 support.

Transcript of Html5

Page 1: Html5

HTML (Frames)

Page 2: Html5

Frames

• With frames, one can display more than one HTML document in the same browser window. Each HTML document is called a frame and each frame is independent of the others.

• The disadvantages of using frames are:– The web developer must keep track of more

HTML documents – It is difficult to print the entire page

Page 3: Html5

Different Frame Tags

Page 4: Html5

Frameset Tag• The <frameset> ….. </frameset> tag defines how

to divide the window into frames • Each frameset defines a set of rows or columns • The values of the rows/columns indicate the

amount of screen area each row/column will occupy

• The frameset element holds two or more frame elements. Each frame element holds a separate document.

Page 5: Html5

Frameset Tag• <frameset>…..</frameset> provides a

outline of the frame.

• Attributes are as follows:

cols=lists of lengths(no. of pixel, percentage, *)

rows=lists of lengths(no. of pixel, percentage, *)

Page 6: Html5

Event Attributes for <frameset>

• onload : Script to be run when a document load

• onunload : Script to be run when a document unload

Page 7: Html5

Frameset Example<html>

<frameset rows="50%,50%">

<frame src="frame_a.htm">

<frameset cols="25%,75%">

<frame src="frame_b.htm">

<frame src="frame_c.htm">

</frameset>

</frameset>

</html>

Page 8: Html5

Result

Page 9: Html5

Frame Tag• <frame /> defines a single frame within a

frameset. Do not have end tag.

• Attributes are as follows (given in the next slide):

src=url

frameborder=1/0 (1 for on & 0 for off)

marginwidth, marginheight, name,

scrolling, noresize, longdesc

Page 10: Html5

Optional Attributes of <frame>

Page 11: Html5

Frames cont..

• <noframes> …… </noframes> defines the contents to be displayed by the browsers that cannot display frames.

• <a href=“new html” target=“main”>…</a> will load new.html into the frame “main”

• <base target=“main”> will cause all the links in the document to load into the frame name “main”

Page 12: Html5

Noframes tag

<frameset cols="25%,50%,25%">

<frame src="frame_a.htm" />

<frame src="frame_b.htm" />

<frame src="frame_c.htm" />

<noframes>

Sorry, your browser does not handle frames

</noframes>

</frameset>

Page 13: Html5

Iframe tag

• The <iframe> ….. </iframe> tag defines an inline frame that contains another document.

• <iframe> comes under the body just like an image.

• The <iframe> tag does not support any event attributes.

• Some of the optional attributes are given in the next slide.

Page 14: Html5

Iframe tag

Page 15: Html5

Another Example<HTML>

<frameset cols="150,*">

<frame src="1.html" name=“main” />

<frameset rows="150,*">

<frame src="logo.jpg">

<frame src="3.html" name=“auxillary” / >

</frameset>

</frameset>

</HTML>

Page 16: Html5

Frames cont…

There are three frames as shown in the figure right side as per the frameset described in the previous slide.