SlideShare a Scribd company logo
WEBPROG1 – HTML                                           Midterm Period
                                                             Handout #6


HTML Frames

     Frames allow for multiple ".html" documents to be displayed inside
of one browser window at a time. This means that one page has no
content on it, but rather tells the browser which web pages you would
like to open.

Frames - A Generic Frame Page

    Frames are most typically used to have a menu in one frame, and
content in another frame. When someone clicks a link on the menu
that web page is then opened on the content page. Here is a classic
example of a basic "index" frameset with a menu on the left and
content on the right.

Code:
<html>
<head>
</head>
<frameset cols="30%,*">
<frame src="menu.html">
<frame src="content.html">
</frameset>
</html>

o frameset - The parent tag that defines the characteristics of this
  frames page. Individual frames are defined inside it.
o frameset cols="#%, *"- Cols(columns) defines the width that
  each frame will have. In the above example we chose the menu
  (the 1st column) to be 30% of the total page and used a "*", which
  means the content (the 2nd column) will use the remaining width
  for itself.
o frame src="" -The location of the web page to load into the frame.
  A good rule of thumb is to call the page which contains this frame
  information "index.html" because that is typically a site's main
  page.




Prepared By: RICHARD F. ORPIANO                              Page 1 of 4
WEBPROG1 – HTML                                             Midterm Period
                                                               Handout #6


Adding a Banner or Title Frame

     Add a row to the top for a title and graphics with the code as
follows:

<html>
<head></head>
<frameset rows="20%,*">
<frame src="title.html">
<frameset cols="30%,*">
<frame src="menu.html">
<frame src="content.html">
</frameset>
</html>

o frameset rows="#%, *"- rows defines the height that each
  frame will have. In the above example we chose the new title (the
  1st row) to be 20% of the total page height and used a "*", which
  means that menu and content (which are the 2nd row) will use the
  remaining height.

FrameBorder and FrameSpacing

    You probably noticed those ugly gray lines that appear between
the frames. It is possible to remove these and manipulate the spacing
between frames with frameborder and framespacing. These attributes
appear within the frameset tag.

    Note: Framespacing and border are the same attribute, but some
browsers only recognize one or the other, so use both, with the same
value, to be safe.

o frameborder="#" - A zero value shows no "window" border.
o border="#"- Modifies the border width, used by Netscape.
o framespacing="#" -Modifies the border width, used by Internet
  Explorer.




Prepared By: RICHARD F. ORPIANO                                Page 2 of 4
WEBPROG1 – HTML                                         Midterm Period
                                                           Handout #6




Code:
<html>
<head></head>
<frameset border="0" frameborder="0" framespacing="0"
rows="20%,*">
<frame src="title.html">
<frameset border="0" frameborder="0" framespacing="0"
cols="30%,*">
<frame src="menu.html">
<frame src="content.html">
</frameset>
</html>

Frame Name and Frame Target

    How nice would it be to make each menu link load into the content
page? We do this by naming each frame and setting the correct base
target inside menu.html.

Frame Code:
<html>
<head></head>
<frameset rows="20%,*">
<frame name="title" src="title.html">
<frameset cols="30%,*">
<frame name="menu" src="menu.html">
<name="content" src="content.html">
</frameset>
</html>

menu.html Code:
<html>
<head>
<base target="content">
</head>
...
</html>

    We first named the content frame "content" on our frame page
and then we set the base target inside menu.html to point to that
frame. Our frame page is now a perfectly functional menu & content
layout!


Prepared By: RICHARD F. ORPIANO                            Page 3 of 4
WEBPROG1 – HTML                                              Midterm Period
                                                                Handout #6


Noresize and Scrolling

    It's possible to further customize the <frame> tag using the
noresize and scrolling="" attributes.

Code:
<html>
<head></head>
<frameset border="2" frameborder="1" framespacing="2"
rows="20%,*">
<frame src="title.html" noresize scrolling="no">
<frameset border="4" frameborder="1" framespacing="4"
cols="30%,*">
<frame src="menu.html" scrolling="auto" noresize>
<frame src="content.html" scrolling="yes" noresize>
</frameset>
</html>

o noresize - Do not let the frames be resized by the visitor.
o scrolling="(yes/no)"- Allow scrolling or not inside a frame.

     We set the scrolling for our content frame to yes to ensure our
visitors will be able to scroll if the content goes off the screen. We also
set the scrolling for our title banner to no, because it does not make
sense to have a scrollbar appear in the title frame.




Prepared By: RICHARD F. ORPIANO                                  Page 4 of 4

More Related Content

DOC
Handout3 links
DOC
Handout2 formatting tags
PDF
Class 4 handout w css3 using j fiddle
PDF
Class 4 handout two column layout w mobile web design
PDF
Class 3 create an absolute layout with css abs position (aptana)
DOC
Handout1 intro to html
PPTX
PDF
Landing Pages 101
Handout3 links
Handout2 formatting tags
Class 4 handout w css3 using j fiddle
Class 4 handout two column layout w mobile web design
Class 3 create an absolute layout with css abs position (aptana)
Handout1 intro to html
Landing Pages 101

What's hot (18)

DOC
Handout7 html forms
RTF
جيفيرا باي الساحل الشمالي
PPTX
Google Earth Tutorials Part III
ODP
Joomla! Day UK 2009 Menus Presentation
ODP
Joomla! Day UK 2009 Basic Templates
RTF
Document
PPTX
Html form
TXT
PPTX
Class13
PPT
SEO Structures by Yavor Milchev
PPTX
Down and dirty with hreflang - Smx munich 2014 - david sottimano
DOC
Theme futura suicida não use como base e nem copie
DOCX
Pagina web tersera
KEY
Getting to Grips with Firebug - Anthony Hortin - WordCamp Sydney
DOC
Css 1
 
PDF
Pemrograman Web 2 - CSS
Handout7 html forms
جيفيرا باي الساحل الشمالي
Google Earth Tutorials Part III
Joomla! Day UK 2009 Menus Presentation
Joomla! Day UK 2009 Basic Templates
Document
Html form
Class13
SEO Structures by Yavor Milchev
Down and dirty with hreflang - Smx munich 2014 - david sottimano
Theme futura suicida não use como base e nem copie
Pagina web tersera
Getting to Grips with Firebug - Anthony Hortin - WordCamp Sydney
Css 1
 
Pemrograman Web 2 - CSS
Ad

Similar to Handout6 html frames (20)

PPTX
HTML FRAMES properties and list of frames in detail
DOCX
Html frames
PPTX
uptu web technology unit 2 html
PPTX
Presentation1
PPTX
HTML Frameset & Inline Frame
PPTX
Final_Frames.pptx
PPTX
Html frames
DOC
Html basics 8 frame
 
PDF
HTML-Part2
PPSX
computer language - Html frames
PPTX
Html Frames
PDF
Ls-No-1 Web Publishing Notes.pdf 12th information technology chapter 1
PDF
2b. Web Technology HTML Basics-2
PPTX
Frames eng
PPT
POLITEKNIK MALAYSIA
PPT
Frames.ppt
PPT
Html frames
PPT
htmlframes-201129101735 (1)htmlframe.ppt
HTML FRAMES properties and list of frames in detail
Html frames
uptu web technology unit 2 html
Presentation1
HTML Frameset & Inline Frame
Final_Frames.pptx
Html frames
Html basics 8 frame
 
HTML-Part2
computer language - Html frames
Html Frames
Ls-No-1 Web Publishing Notes.pdf 12th information technology chapter 1
2b. Web Technology HTML Basics-2
Frames eng
POLITEKNIK MALAYSIA
Frames.ppt
Html frames
htmlframes-201129101735 (1)htmlframe.ppt
Ad

More from Nadine Guevarra (18)

DOC
Handout5 tables
DOC
Handout4 lists
DOCX
Chapter 3
DOCX
Chapter 2
DOCX
Chapter 1
DOCX
Questionnaire
PPT
War and man’s past
PPT
Olympics
PPT
Mother and child
PPT
Lec no. 3 comp hardware components
PPTX
Intro to spreadsheet
PPT
Excel.01
PPT
Robert frost 001
PPTX
On giving 001
PPT
Poetry 001
PPT
Robert frost 001
PPTX
The river merchant's wife 001
PPTX
Wl lecture 2 essay 001
Handout5 tables
Handout4 lists
Chapter 3
Chapter 2
Chapter 1
Questionnaire
War and man’s past
Olympics
Mother and child
Lec no. 3 comp hardware components
Intro to spreadsheet
Excel.01
Robert frost 001
On giving 001
Poetry 001
Robert frost 001
The river merchant's wife 001
Wl lecture 2 essay 001

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
cuic standard and advanced reporting.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Approach and Philosophy of On baking technology
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Modernizing your data center with Dell and AMD
Reach Out and Touch Someone: Haptics and Empathic Computing
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
The AUB Centre for AI in Media Proposal.docx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Network Security Unit 5.pdf for BCA BBA.
Dropbox Q2 2025 Financial Results & Investor Presentation
Chapter 3 Spatial Domain Image Processing.pdf
Spectral efficient network and resource selection model in 5G networks
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Review of recent advances in non-invasive hemoglobin estimation
cuic standard and advanced reporting.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Advanced methodologies resolving dimensionality complications for autism neur...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Digital-Transformation-Roadmap-for-Companies.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Approach and Philosophy of On baking technology
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Modernizing your data center with Dell and AMD

Handout6 html frames

  • 1. WEBPROG1 – HTML Midterm Period Handout #6 HTML Frames Frames allow for multiple ".html" documents to be displayed inside of one browser window at a time. This means that one page has no content on it, but rather tells the browser which web pages you would like to open. Frames - A Generic Frame Page Frames are most typically used to have a menu in one frame, and content in another frame. When someone clicks a link on the menu that web page is then opened on the content page. Here is a classic example of a basic "index" frameset with a menu on the left and content on the right. Code: <html> <head> </head> <frameset cols="30%,*"> <frame src="menu.html"> <frame src="content.html"> </frameset> </html> o frameset - The parent tag that defines the characteristics of this frames page. Individual frames are defined inside it. o frameset cols="#%, *"- Cols(columns) defines the width that each frame will have. In the above example we chose the menu (the 1st column) to be 30% of the total page and used a "*", which means the content (the 2nd column) will use the remaining width for itself. o frame src="" -The location of the web page to load into the frame. A good rule of thumb is to call the page which contains this frame information "index.html" because that is typically a site's main page. Prepared By: RICHARD F. ORPIANO Page 1 of 4
  • 2. WEBPROG1 – HTML Midterm Period Handout #6 Adding a Banner or Title Frame Add a row to the top for a title and graphics with the code as follows: <html> <head></head> <frameset rows="20%,*"> <frame src="title.html"> <frameset cols="30%,*"> <frame src="menu.html"> <frame src="content.html"> </frameset> </html> o frameset rows="#%, *"- rows defines the height that each frame will have. In the above example we chose the new title (the 1st row) to be 20% of the total page height and used a "*", which means that menu and content (which are the 2nd row) will use the remaining height. FrameBorder and FrameSpacing You probably noticed those ugly gray lines that appear between the frames. It is possible to remove these and manipulate the spacing between frames with frameborder and framespacing. These attributes appear within the frameset tag. Note: Framespacing and border are the same attribute, but some browsers only recognize one or the other, so use both, with the same value, to be safe. o frameborder="#" - A zero value shows no "window" border. o border="#"- Modifies the border width, used by Netscape. o framespacing="#" -Modifies the border width, used by Internet Explorer. Prepared By: RICHARD F. ORPIANO Page 2 of 4
  • 3. WEBPROG1 – HTML Midterm Period Handout #6 Code: <html> <head></head> <frameset border="0" frameborder="0" framespacing="0" rows="20%,*"> <frame src="title.html"> <frameset border="0" frameborder="0" framespacing="0" cols="30%,*"> <frame src="menu.html"> <frame src="content.html"> </frameset> </html> Frame Name and Frame Target How nice would it be to make each menu link load into the content page? We do this by naming each frame and setting the correct base target inside menu.html. Frame Code: <html> <head></head> <frameset rows="20%,*"> <frame name="title" src="title.html"> <frameset cols="30%,*"> <frame name="menu" src="menu.html"> <name="content" src="content.html"> </frameset> </html> menu.html Code: <html> <head> <base target="content"> </head> ... </html> We first named the content frame "content" on our frame page and then we set the base target inside menu.html to point to that frame. Our frame page is now a perfectly functional menu & content layout! Prepared By: RICHARD F. ORPIANO Page 3 of 4
  • 4. WEBPROG1 – HTML Midterm Period Handout #6 Noresize and Scrolling It's possible to further customize the <frame> tag using the noresize and scrolling="" attributes. Code: <html> <head></head> <frameset border="2" frameborder="1" framespacing="2" rows="20%,*"> <frame src="title.html" noresize scrolling="no"> <frameset border="4" frameborder="1" framespacing="4" cols="30%,*"> <frame src="menu.html" scrolling="auto" noresize> <frame src="content.html" scrolling="yes" noresize> </frameset> </html> o noresize - Do not let the frames be resized by the visitor. o scrolling="(yes/no)"- Allow scrolling or not inside a frame. We set the scrolling for our content frame to yes to ensure our visitors will be able to scroll if the content goes off the screen. We also set the scrolling for our title banner to no, because it does not make sense to have a scrollbar appear in the title frame. Prepared By: RICHARD F. ORPIANO Page 4 of 4