SlideShare une entreprise Scribd logo
1  sur  6
Lecture 9
In this lecture, we will learn about
    - Frames

What are Frames?
Frames are a way to put one more than one page at a time on a computer screen. Usually
frames are made, to add a menu on one side, and the corresponding pages on the other
side by clicking each option of the menu.




Here is the code for the above
<html>
<head><title>Using Frames</title></head>

<frameset cols="15%,85%">
 <frame src="menu_bar.htm" name="sidemenu">
 <frame src="main.htm" name="mainwindow">
</frameset>

Note that there is no actual body coding involved when creating frames.

About <frameset> and <frame>
The frameset tag is used to declare multiple frames. As you can see in the above example,
there was one frameset, and it reads as

<frameset cols="15%,85%">
This tells the browser that we are creating column of framed pages, in this case two
frames, each in one column. The first one will take the 15% of the total browser screen
and the second one will take 85% of the total browser screen.

After that we use frame tag, which actually loads the desired web page. Each frame must
have a source, such as src=”webpage.html”. So, because we used two framed areas
within the frameset, we need two frame tags, each of them to load a page.

<frameset cols="15%,85%">
 <frame src="menu_bar.htm" name="sidemenu">
 <frame src="main.htm" name="mainwindow">
</frameset>



If we would like to add a third column, we would need to add a third size definition in the
cols (so that all would add up to 100%) and another frame tag inside the frameset.

In the above case we had a vertical menu bar; we can also have a horizontal menu bar.
For that we have to use rows instead of cols. For example

<frameset rows="15%,85%">
 <frame src="menu_bar.htm" name="sidemenu">
 <frame src="main.htm" name="mainwindow">
</frameset>


Linking with Frames
Now, let us take an example which you have been using, yes it is your course URL i.e.
http://kumarharmuscat.tripod.com/iprogram. I am using frames in that.

<html>

<head>

         <title>Internet Programming</title>

</head>

         <frameset cols="20%,80%">

                <frame name="lp" src="leftpane.html">

                <frame name="rp" src="ip.html">

         </frameset>

</html>
So, in the above code, I have divided the whole webpage into two frames, first frame
contains the menu and is on the left, second frame load the menu link.

Let us look at the coding of leftpane.html

<html>

<body>

<B>Intenet Programming</B>

<font size=2 type="arial">

<a href="ipcontents.html" target="rp">Course Contents</a><br>

<a href="ethics.html" target="rp">Code Of Ethics</a><br>

<a href="qb.html" target="rp">Assignment</a><br>

<a href="schedule.html" target="rp">Lecture Notes</a><br>

<a href="project.html" target="rp">Project</a><br>

</body>

</html>

Notice, that there is no head tag here. It is quite obvious that I don’t need a head tag now,
because this webpage is contained inside another webpage.

The output of this web page is

Intenet Programming

Course Contents
Grading Policy
Assignment
Lecture Notes
Project

So, when you click on “Course Contents”, your course content opens, when you click on
Grading policy, the page corresponding to grading policy i.e. “ethics.html” opens and
same is the case with other links.

Q How come when you click on the menu option, the page opens in the second frame?
A) This is possible through the target attribute of anchor tag.

Notice two things, when I created frames, I gave a name to each frame.
<html>

<head>

         <title>Internet Programming</title>

</head>

         <frameset cols="20%,80%">

                <frame name="lp" src="leftpane.html">

                <frame name="rp" src="ip.html">

         </frameset>

</html>

So, the name of frame on the left is “lp”, and the name of frame on the right is “rp”.

If I don’t specify target attribute in the anchor tag, then on clicking the menu option, the
page will open in the first frame on the left, and nothing will open in the second frame.
So, I specify where I want the page to open.

There are other possibilities with the target attribute of anchor tag.
   - target="_blank" - link is loaded into a new blank browser window (and your
       old window stays open).
   - target="_self" - link is loaded into frame that link was clicked in. (this is the
       default selection. Leave it out if you so please.)
   - target="_top" - link is loaded into current full browser window, and all frames
       disappear, leaving the new linked page to occupy the entire window.

Special attributes of                              <frame>


Q) Can I change the size of the frame using my mouse, I mean taking my mouse over the
vertical bar, then left click and dragging it to the left or right?
A) Yes

Q) What if I don’t want the user to drag the vertical boundary?
A) The solution is below




<html>
<head>

       <title>Internet Programming</title>

</head>

       <frameset cols="20%,80%">

              <frame name="lp" src="leftpane.html" noresize>

              <frame name="rp" src="ip.html">

       </frameset>

</html>

The other useful attribute is scrolling. Say you always want a scrollbar to appear in the
main window. Add scrolling="yes". Want there to never be a scrollbar? Add
scrolling="no".

To understand more about scrolling, type the following code

<html>
<head>
       <title>Internet Programming</title>
</head>
       <frameset cols="20%,80%">
               <frame name="lp" src="leftpane.html">
               <frame name="rp" src="ip.html" scrolling="yes">
       </frameset>
</html>



More Advanced Frames
Let us discuss move advanced frames now, where we will see how to divide the browser
window into more than two frames. Take an example first

<frameset cols="15%,85%">
<frameset rows="20%,80%">
  <frame src="timetable.html">
  <frame src="hobbies.html" name="sidemenu">
</frameset>
<frame src="first.html" name="mainwindow">
</frameset>
In the above code, browser window is divided into two frames vertically, first frame is
15% of the total size of the browser, and the second frame is 85% of the total size of the
browser. Then again the first frame is divided into two more frames, i.e. the frame which
occupied 15% is again divided into two frames horizontally, and the ratio is 20% and
80%.

<frameset rows="50%,50%">
 <frameset cols="50%,50%">
   <frame>
   <frame>
 </frameset>
 <frameset cols="50%,50%">
   <frame>
   <frame>
 </frameset>

The above code will divide the browser window into four frames, each of equal size.

<frameset cols="33%,33%,33%">
  <frame>
  <frame>
  <frame>
</frameset>

The above code will divide the browser window vertically into three frames each
occupying 33% of the total browser window size.

<frameset rows="25%,50%,25%">
 <frame>
 <frame>
 <frame>
</frameset>

The above code will divide the browser window horizontally into three frame, first frame
occupies the 25% of the total browser window, second frame occupies the 50% of the
total browser window, and third frame occupies the 25% of the total browser window.

-------------------------------------------------Finish---------------------------------------------------

Contenu connexe

Tendances

POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
Frames eng
Frames engFrames eng
Frames engAc Rte
 
DEFINE FRAME AND FRAME SET WITH EXAMPLE
DEFINE FRAME AND FRAME SET WITH EXAMPLEDEFINE FRAME AND FRAME SET WITH EXAMPLE
DEFINE FRAME AND FRAME SET WITH EXAMPLEpatelpriyank01
 
Wordpress workflow for an agency world
Wordpress workflow for an agency worldWordpress workflow for an agency world
Wordpress workflow for an agency worldChris Lowe
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionIn a Rocket
 
html for beginners
html for beginnershtml for beginners
html for beginnersKIIZAPHILIP
 
The complete-html-cheat-sheet
The complete-html-cheat-sheetThe complete-html-cheat-sheet
The complete-html-cheat-sheetHARUN PEHLIVAN
 
Bliblidotcom - Reintroduction BEM CSS
Bliblidotcom - Reintroduction BEM CSSBliblidotcom - Reintroduction BEM CSS
Bliblidotcom - Reintroduction BEM CSSIrfan Maulana
 
Getting to Grips with Firebug - Anthony Hortin - WordCamp Sydney
Getting to Grips with Firebug - Anthony Hortin - WordCamp SydneyGetting to Grips with Firebug - Anthony Hortin - WordCamp Sydney
Getting to Grips with Firebug - Anthony Hortin - WordCamp SydneyWordCamp Sydney
 
The Future is Modular, Jonathan Snook
The Future is Modular, Jonathan SnookThe Future is Modular, Jonathan Snook
The Future is Modular, Jonathan SnookFuture Insights
 

Tendances (19)

Html frames
Html framesHtml frames
Html frames
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Ddpz2613 topic6 frame
Ddpz2613 topic6 frameDdpz2613 topic6 frame
Ddpz2613 topic6 frame
 
Presentation1
Presentation1Presentation1
Presentation1
 
Frames eng
Frames engFrames eng
Frames eng
 
Html Frames
Html FramesHtml Frames
Html Frames
 
DEFINE FRAME AND FRAME SET WITH EXAMPLE
DEFINE FRAME AND FRAME SET WITH EXAMPLEDEFINE FRAME AND FRAME SET WITH EXAMPLE
DEFINE FRAME AND FRAME SET WITH EXAMPLE
 
Wordpress workflow for an agency world
Wordpress workflow for an agency worldWordpress workflow for an agency world
Wordpress workflow for an agency world
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
 
html for beginners
html for beginnershtml for beginners
html for beginners
 
Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
 
The complete-html-cheat-sheet
The complete-html-cheat-sheetThe complete-html-cheat-sheet
The complete-html-cheat-sheet
 
Html5
Html5Html5
Html5
 
HTML CSS & Javascript
HTML CSS & JavascriptHTML CSS & Javascript
HTML CSS & Javascript
 
Bliblidotcom - Reintroduction BEM CSS
Bliblidotcom - Reintroduction BEM CSSBliblidotcom - Reintroduction BEM CSS
Bliblidotcom - Reintroduction BEM CSS
 
Getting to Grips with Firebug - Anthony Hortin - WordCamp Sydney
Getting to Grips with Firebug - Anthony Hortin - WordCamp SydneyGetting to Grips with Firebug - Anthony Hortin - WordCamp Sydney
Getting to Grips with Firebug - Anthony Hortin - WordCamp Sydney
 
Sacramento web design
Sacramento web designSacramento web design
Sacramento web design
 
css-tutorial
css-tutorialcss-tutorial
css-tutorial
 
The Future is Modular, Jonathan Snook
The Future is Modular, Jonathan SnookThe Future is Modular, Jonathan Snook
The Future is Modular, Jonathan Snook
 

Similaire à Html basics 8 frame

HTML Frameset & Inline Frame
HTML Frameset & Inline FrameHTML Frameset & Inline Frame
HTML Frameset & Inline FrameNisa Soomro
 
Web 2.0 Lessonplan Day1
Web 2.0 Lessonplan Day1Web 2.0 Lessonplan Day1
Web 2.0 Lessonplan Day1Jesse Thomas
 
Accelerated Mobile Pages (AMP) in Magento
Accelerated Mobile Pages (AMP) in MagentoAccelerated Mobile Pages (AMP) in Magento
Accelerated Mobile Pages (AMP) in MagentoMagecom UK Limited
 
Haml And Sass
Haml And SassHaml And Sass
Haml And Sasswear
 
2b. Web Technology HTML Basics-2
2b. Web Technology HTML Basics-22b. Web Technology HTML Basics-2
2b. Web Technology HTML Basics-2Jyoti Yadav
 
Hypertext_markup_language
Hypertext_markup_languageHypertext_markup_language
Hypertext_markup_languageIshaq Shinwari
 
Build an App with JavaScript and jQuery - LA - July 18
Build an App with JavaScript and jQuery - LA - July 18Build an App with JavaScript and jQuery - LA - July 18
Build an App with JavaScript and jQuery - LA - July 18Thinkful
 
Frames and its components
Frames and its components Frames and its components
Frames and its components Deepam Aggarwal
 
Webinar: Front End Web Development - Trendy Web Designs Using HTML5
Webinar: Front End Web Development - Trendy Web Designs Using HTML5Webinar: Front End Web Development - Trendy Web Designs Using HTML5
Webinar: Front End Web Development - Trendy Web Designs Using HTML5Edureka!
 
Responsive Design and Bootstrap
Responsive Design  and BootstrapResponsive Design  and Bootstrap
Responsive Design and BootstrapMahmoudOHassouna
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
Mobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web DesignMobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web DesignCantina
 
Useful Rails Plugins
Useful Rails PluginsUseful Rails Plugins
Useful Rails Pluginsnavjeet
 

Similaire à Html basics 8 frame (20)

HTML Frameset & Inline Frame
HTML Frameset & Inline FrameHTML Frameset & Inline Frame
HTML Frameset & Inline Frame
 
Handout6 html frames
Handout6 html framesHandout6 html frames
Handout6 html frames
 
Web 2.0 Lessonplan Day1
Web 2.0 Lessonplan Day1Web 2.0 Lessonplan Day1
Web 2.0 Lessonplan Day1
 
Accelerated Mobile Pages (AMP) in Magento
Accelerated Mobile Pages (AMP) in MagentoAccelerated Mobile Pages (AMP) in Magento
Accelerated Mobile Pages (AMP) in Magento
 
HTML-Part2
HTML-Part2HTML-Part2
HTML-Part2
 
Haml And Sass
Haml And SassHaml And Sass
Haml And Sass
 
2b. Web Technology HTML Basics-2
2b. Web Technology HTML Basics-22b. Web Technology HTML Basics-2
2b. Web Technology HTML Basics-2
 
Bootstrap 3
Bootstrap 3Bootstrap 3
Bootstrap 3
 
Hypertext_markup_language
Hypertext_markup_languageHypertext_markup_language
Hypertext_markup_language
 
Build an App with JavaScript and jQuery - LA - July 18
Build an App with JavaScript and jQuery - LA - July 18Build an App with JavaScript and jQuery - LA - July 18
Build an App with JavaScript and jQuery - LA - July 18
 
Frames and its components
Frames and its components Frames and its components
Frames and its components
 
Css web gallery
Css web galleryCss web gallery
Css web gallery
 
Webinar: Front End Web Development - Trendy Web Designs Using HTML5
Webinar: Front End Web Development - Trendy Web Designs Using HTML5Webinar: Front End Web Development - Trendy Web Designs Using HTML5
Webinar: Front End Web Development - Trendy Web Designs Using HTML5
 
Responsive Design and Bootstrap
Responsive Design  and BootstrapResponsive Design  and Bootstrap
Responsive Design and Bootstrap
 
Css, xhtml, javascript
Css, xhtml, javascriptCss, xhtml, javascript
Css, xhtml, javascript
 
Frames.ppt
Frames.pptFrames.ppt
Frames.ppt
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Mobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web DesignMobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web Design
 
Day1
Day1Day1
Day1
 
Useful Rails Plugins
Useful Rails PluginsUseful Rails Plugins
Useful Rails Plugins
 

Plus de H K

Assignment4
Assignment4Assignment4
Assignment4H K
 
Assignment3
Assignment3Assignment3
Assignment3H K
 
Induction
InductionInduction
InductionH K
 
Solution3
Solution3Solution3
Solution3H K
 
Solution2
Solution2Solution2
Solution2H K
 
Mid-
Mid-Mid-
Mid-H K
 
Assignment4
Assignment4Assignment4
Assignment4H K
 
Assignment4
Assignment4Assignment4
Assignment4H K
 
Dm assignment3
Dm assignment3Dm assignment3
Dm assignment3H K
 
Proof
ProofProof
ProofH K
 
Resolution
ResolutionResolution
ResolutionH K
 
Assignment description
Assignment descriptionAssignment description
Assignment descriptionH K
 
Dm assignment2
Dm assignment2Dm assignment2
Dm assignment2H K
 
Set
SetSet
SetH K
 
Dm assignment1
Dm assignment1Dm assignment1
Dm assignment1H K
 
Logic
LogicLogic
LogicH K
 
Introduction
IntroductionIntroduction
IntroductionH K
 
Assignment 2 sol
Assignment 2 solAssignment 2 sol
Assignment 2 solH K
 
Assignment sw solution
Assignment sw solutionAssignment sw solution
Assignment sw solutionH K
 
Violinphoenix
ViolinphoenixViolinphoenix
ViolinphoenixH K
 

Plus de H K (20)

Assignment4
Assignment4Assignment4
Assignment4
 
Assignment3
Assignment3Assignment3
Assignment3
 
Induction
InductionInduction
Induction
 
Solution3
Solution3Solution3
Solution3
 
Solution2
Solution2Solution2
Solution2
 
Mid-
Mid-Mid-
Mid-
 
Assignment4
Assignment4Assignment4
Assignment4
 
Assignment4
Assignment4Assignment4
Assignment4
 
Dm assignment3
Dm assignment3Dm assignment3
Dm assignment3
 
Proof
ProofProof
Proof
 
Resolution
ResolutionResolution
Resolution
 
Assignment description
Assignment descriptionAssignment description
Assignment description
 
Dm assignment2
Dm assignment2Dm assignment2
Dm assignment2
 
Set
SetSet
Set
 
Dm assignment1
Dm assignment1Dm assignment1
Dm assignment1
 
Logic
LogicLogic
Logic
 
Introduction
IntroductionIntroduction
Introduction
 
Assignment 2 sol
Assignment 2 solAssignment 2 sol
Assignment 2 sol
 
Assignment sw solution
Assignment sw solutionAssignment sw solution
Assignment sw solution
 
Violinphoenix
ViolinphoenixViolinphoenix
Violinphoenix
 

Dernier

9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 

Dernier (20)

9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 

Html basics 8 frame

  • 1. Lecture 9 In this lecture, we will learn about - Frames What are Frames? Frames are a way to put one more than one page at a time on a computer screen. Usually frames are made, to add a menu on one side, and the corresponding pages on the other side by clicking each option of the menu. Here is the code for the above <html> <head><title>Using Frames</title></head> <frameset cols="15%,85%"> <frame src="menu_bar.htm" name="sidemenu"> <frame src="main.htm" name="mainwindow"> </frameset> Note that there is no actual body coding involved when creating frames. About <frameset> and <frame> The frameset tag is used to declare multiple frames. As you can see in the above example, there was one frameset, and it reads as <frameset cols="15%,85%">
  • 2. This tells the browser that we are creating column of framed pages, in this case two frames, each in one column. The first one will take the 15% of the total browser screen and the second one will take 85% of the total browser screen. After that we use frame tag, which actually loads the desired web page. Each frame must have a source, such as src=”webpage.html”. So, because we used two framed areas within the frameset, we need two frame tags, each of them to load a page. <frameset cols="15%,85%"> <frame src="menu_bar.htm" name="sidemenu"> <frame src="main.htm" name="mainwindow"> </frameset> If we would like to add a third column, we would need to add a third size definition in the cols (so that all would add up to 100%) and another frame tag inside the frameset. In the above case we had a vertical menu bar; we can also have a horizontal menu bar. For that we have to use rows instead of cols. For example <frameset rows="15%,85%"> <frame src="menu_bar.htm" name="sidemenu"> <frame src="main.htm" name="mainwindow"> </frameset> Linking with Frames Now, let us take an example which you have been using, yes it is your course URL i.e. http://kumarharmuscat.tripod.com/iprogram. I am using frames in that. <html> <head> <title>Internet Programming</title> </head> <frameset cols="20%,80%"> <frame name="lp" src="leftpane.html"> <frame name="rp" src="ip.html"> </frameset> </html>
  • 3. So, in the above code, I have divided the whole webpage into two frames, first frame contains the menu and is on the left, second frame load the menu link. Let us look at the coding of leftpane.html <html> <body> <B>Intenet Programming</B> <font size=2 type="arial"> <a href="ipcontents.html" target="rp">Course Contents</a><br> <a href="ethics.html" target="rp">Code Of Ethics</a><br> <a href="qb.html" target="rp">Assignment</a><br> <a href="schedule.html" target="rp">Lecture Notes</a><br> <a href="project.html" target="rp">Project</a><br> </body> </html> Notice, that there is no head tag here. It is quite obvious that I don’t need a head tag now, because this webpage is contained inside another webpage. The output of this web page is Intenet Programming Course Contents Grading Policy Assignment Lecture Notes Project So, when you click on “Course Contents”, your course content opens, when you click on Grading policy, the page corresponding to grading policy i.e. “ethics.html” opens and same is the case with other links. Q How come when you click on the menu option, the page opens in the second frame? A) This is possible through the target attribute of anchor tag. Notice two things, when I created frames, I gave a name to each frame.
  • 4. <html> <head> <title>Internet Programming</title> </head> <frameset cols="20%,80%"> <frame name="lp" src="leftpane.html"> <frame name="rp" src="ip.html"> </frameset> </html> So, the name of frame on the left is “lp”, and the name of frame on the right is “rp”. If I don’t specify target attribute in the anchor tag, then on clicking the menu option, the page will open in the first frame on the left, and nothing will open in the second frame. So, I specify where I want the page to open. There are other possibilities with the target attribute of anchor tag. - target="_blank" - link is loaded into a new blank browser window (and your old window stays open). - target="_self" - link is loaded into frame that link was clicked in. (this is the default selection. Leave it out if you so please.) - target="_top" - link is loaded into current full browser window, and all frames disappear, leaving the new linked page to occupy the entire window. Special attributes of <frame> Q) Can I change the size of the frame using my mouse, I mean taking my mouse over the vertical bar, then left click and dragging it to the left or right? A) Yes Q) What if I don’t want the user to drag the vertical boundary? A) The solution is below <html>
  • 5. <head> <title>Internet Programming</title> </head> <frameset cols="20%,80%"> <frame name="lp" src="leftpane.html" noresize> <frame name="rp" src="ip.html"> </frameset> </html> The other useful attribute is scrolling. Say you always want a scrollbar to appear in the main window. Add scrolling="yes". Want there to never be a scrollbar? Add scrolling="no". To understand more about scrolling, type the following code <html> <head> <title>Internet Programming</title> </head> <frameset cols="20%,80%"> <frame name="lp" src="leftpane.html"> <frame name="rp" src="ip.html" scrolling="yes"> </frameset> </html> More Advanced Frames Let us discuss move advanced frames now, where we will see how to divide the browser window into more than two frames. Take an example first <frameset cols="15%,85%"> <frameset rows="20%,80%"> <frame src="timetable.html"> <frame src="hobbies.html" name="sidemenu"> </frameset> <frame src="first.html" name="mainwindow"> </frameset>
  • 6. In the above code, browser window is divided into two frames vertically, first frame is 15% of the total size of the browser, and the second frame is 85% of the total size of the browser. Then again the first frame is divided into two more frames, i.e. the frame which occupied 15% is again divided into two frames horizontally, and the ratio is 20% and 80%. <frameset rows="50%,50%"> <frameset cols="50%,50%"> <frame> <frame> </frameset> <frameset cols="50%,50%"> <frame> <frame> </frameset> The above code will divide the browser window into four frames, each of equal size. <frameset cols="33%,33%,33%"> <frame> <frame> <frame> </frameset> The above code will divide the browser window vertically into three frames each occupying 33% of the total browser window size. <frameset rows="25%,50%,25%"> <frame> <frame> <frame> </frameset> The above code will divide the browser window horizontally into three frame, first frame occupies the 25% of the total browser window, second frame occupies the 50% of the total browser window, and third frame occupies the 25% of the total browser window. -------------------------------------------------Finish---------------------------------------------------