|1. Index||7. Hyperlinks|
|2. Hyper Text Markup Language (Introduction)||8. Marquee Tag|
|3. Common Tags||9. Tables|
|4. DOCTYPE in HTML||10. Lists|
|5. Formatting Tags||11. HTML Frames|
|6. Inserting an Image||12. Forms|
|13. HTML Media|
Lecture-10 : FRAMES IN HTML
Lecture-10 : FRAMES IN HTML
HTML frames are used to divide your browser window into multiple sections. In each frame we can open or load a separate HTML document. Two or more HTML documents can be seen in the browser simultaneously. A collection of frames in the browser window is known as a frameset.
To have frames in window we use frames. To do this we use the <frameset> tag which indicates the browser that the web page window has frame and corresponding tag to close the frame </frameset>. We can divide a window into multiple into multiple frames. This can be done by <frameset> …..... </frameset> tag. We can divide it into rows and columns by using framesetattribute such as rows and cols.
We can make hyperlinks in between the HTML documents existing on different frames. The main benefit of this approach is in the navigation. Users can view the information in one frame while keeping the other frame open for reference.
Advantages of Using Frames
• One of the most beneficial feature of frames is it lets the user to have multiple pages in the same browser.
• Using frames we can keep one part of the page static while changing the other parts of the page.
• If we create a top frame we can use it as a header i.e, as that page is static it acts like an include page.
• Frames can be used to reduce server load, as there is no need to reload all the pages when ever a new page is visited .
Disadvantages of Using Frames
• One of the main disadvantage of frames is search engines will not deal with them properly. i.e, search engines (including most popular ones) will not index pages containing frames as its hard for them to search for a specific content and move backwards to check to which frameset each page belongs to and retrieve all the pages in the frameset.
• Its hard to navigate through pages in frames when we have more than two or three frames.
• Its difficult to print the content of all frames when compared to a normal web page.
• Some browsers doesn't support frames, so we need to place the content separately for the people who doesn't have frames using <noframes> ... </noframes>.
• We cannot bookmark individual pages using browser's Favorites Menu.
Attributes of Frame tag:-
src :- This attribute is used to give the file name that should be loaded in the frame. Its value can be any URL. For example, src="top.html" will load an HTML file available in html directory.
Frameborder :- This attribute specifies that the border of the frame is shown or not; it overrides the value given in the frameborder attribute on the <frameset> tag if one is given, and this can take values either 1 (yes) or 0 (no).
Target Element :- The hyperlink frame contains this hyperlink code contains an anchor tag as example, <a href=”index.html” target=”frame1”> target is an anchor element and index.html file will be loaded in the frame whose name is “frame1”. Target can be setto many values such as
_self :- it displays the page in the same browser window.
_blank :- It displays the page in a new blank browser window.
_parent :- it change the frameset which encapsulate the current frame.
_top :- It enables the full browser window to display the requested page.
Scrolling :- This attribute specifies to show the scrollbars or not that appear on the frame. This takes values either "yes", "no" or "auto". For example scrolling="no" means it should not have scroll bars.
<frameset rows = "40%, *">
<frame src="top.html" name="upper" >
<frame src="" name= " lower" >