0% found this document useful (0 votes)
3 views19 pages

Understanding HTML Frames and Attributes

HTML frames allow the division of a browser window into multiple sections, each capable of loading separate HTML documents. However, they have disadvantages such as poor printing support, compatibility issues with smaller devices, and inconsistent display across different resolutions. The document also details the <frameset> and <frame> elements, their attributes, and provides examples of HTML frame codes.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views19 pages

Understanding HTML Frames and Attributes

HTML frames allow the division of a browser window into multiple sections, each capable of loading separate HTML documents. However, they have disadvantages such as poor printing support, compatibility issues with smaller devices, and inconsistent display across different resolutions. The document also details the <frameset> and <frame> elements, their attributes, and provides examples of HTML frame codes.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

HTML

HTML
Tutorials
Lesson 8: HTML Frames
Discussion Flow
1. Define HTML Frames
2. Disadvantages of HTML Frames
3. Frameset Element and Its Attributes
4. Frame Element and its Attribute
5. Examples of HTML Frame Codes
HTML
HTML Frames

- are used to divide your browser window into


multiple sections where each section can load a
separate HTML document. A collection of frames in
the browser window is known as a frameset.

HTML
HTML Frames Drawback
1. Some browsers do not print well from framesets.
2. Some smaller devices cannot cope with frames. Often
because their screen is not big enough to be divided up.
3. Sometime your page will be displayed differently on
different computers due to different screen resolution.
4. The browser’s back button might not work as the user
hopes.
5. There are still few browsers who do not support frame
technology HTML
Frameset Element
- the <frameset> element replaces the <body> element in
frameset documents
- the <frameset> element defines how to divide the window
into frames.
- each frameset defines a set of rows or columns. If you define
frames by using rows then horizontal frames are created. If
you define frames by using columns then vertical frames are
created.
- the values of the rows/columns indicate the amount of HTML

screen area each row/column will occupy.


The <frameset>…</frameset> Element

<html>
<head><title> FRAMING TAGS</title></head>
<frameset attribute=“value”>
<frame attribute=“html file”>
</frameset>
</html>

HTML
The <frameset> Attributes
• Cols
• Rows
• Border
• Frameborder
• framespacing HTML
The <frameset> Attributes

• cols – specifies how many


columns are contained in the
frameset and the size of each
column.
HTML
<html>
<head><title> FRAMING
TAGS</title></head>
<frameset cols="50%,50%">
<frame attribute=“html document">
<frame attribute=“html document">
</frameset>
HTML

</html>
The <frameset> Attributes

• rows – specifies how many rows


• are contained in the frameset
and the size of each column.
HTML
<html>
<head><title> FRAMING
TAGS</title></head>
<frameset rows="50%,50%">
<frame attribute=“html document">
<frame attribute=“html document">
</frameset>
</html> HTML
The <frameset> Attributes

• border – specifies the width of


the border of each frame in
pixels. .
HTML
<html>
<head><title> FRAMING
TAGS</title></head>
<frameset rows="50%,50%“ border=“2”>
<frame attribute=“html document">
<frame attribute=“html document">
</frameset>
</html> HTML
The <frameset> Attributes

• frameborder – specifies
whether a three dimensional
border should be displayed
between frames..
HTML
<html>
<head><title> FRAMING TAGS</title></head>
<frameset rows="50%,50%“ frameborder=“1”>
<frame attribute=“html document">
<frame attribute=“html document">
</frameset>
</html>
HTML
The <frameset> Attributes

• framespacing – specifies the


amount of space between
frames in a frameset.
HTML
<html>
<head><title> FRAMING TAGS</title></head>
<frameset rows="50%,50%“ framespacing=“2”>
<frame attribute=“html document">
<frame attribute=“html document">
</frameset>
</html>
HTML
The <frame>…</frame> Element
this tag contains the frame content. It tells the browser, what to put in each frame. Each
frameset must include a <FRAME> definition for each division. It is a singular tag.

Attributes:
➢Src: indicates the URL of the document to be loaded into the frame.
➢MarginHeight: specifies the amount of white space to be left at the top and
bottom of the frame.
➢MarginWidth: specifies the amount of white space to be left along the sides of
the frame.
➢Name: gives the frame a unique name so it can be targeted by other documents.
The name given must be given with an alphanumeric character.
➢Noresize: disables the frame resizing capability.
➢Scrolling: controls the appearance of horizontal and vertical scrollbars in a [Link]
This takes the value YES/NO/AUTO.
Thanks for
watching and
listening HTML

Common questions

Powered by AI

HTML frames can negatively impact user experience due to a few disadvantages. Some browsers do not print well from framesets, which can hinder users' ability to save or share content. Additionally, smaller devices may struggle with frames because their screens cannot accommodate divided sections effectively. Frames can lead to inconsistent displays on different computers due to variations in screen resolution. The browser’s back button might also not function as expected, potentially causing navigation issues. Finally, some browsers do not support frame technology, affecting compatibility and accessibility .

The 'noresize' attribute can be advantageous in web design for preventing users from altering the dimensions of a frame, which ensures a consistent layout and presentation across different viewing conditions. This can be particularly important for maintaining design integrity and preventing user-induced errors that could disrupt the visual coherence or functionality of a web page .

Both 'border' and 'frameborder' attributes in a <frameset> control aspects of frame borders, but they serve different purposes. The 'border' attribute specifies the width of each frame's borders in pixels, determining how thick the dividing lines between frames will appear. In contrast, the 'frameborder' attribute indicates whether a three-dimensional border is rendered between frames, thus affecting the visual separation. Together, they dictate not just the presence of borders but also their visual style .

HTML frames impact the usability of browser navigation tools negatively because they can disrupt the standard processing of URL changes in the address bar. When navigating within frames, the URL remains unchanged, causing the browser's back and forward buttons to not work as expected. This means users cannot reliably use these buttons to navigate between different views or states of web content, leading to confusion and a suboptimal user experience .

Defining unique names for frames using the 'name' attribute is important because it allows frames to be targeted by links or scripts from other documents. This capability is essential for creating dynamic web experiences where clicking a link or executing a script in one frame can change the content of another, facilitating communication between different parts of a web page and enabling more interactive and sophisticated web applications .

The 'scrolling' attribute is crucial in scenarios where the content within a frame exceeds the frame’s visible area. By controlling the appearance of horizontal and vertical scrollbars with values 'YES', 'NO', or 'AUTO', designers can either allow or prevent scrolling as needed. This improves usability by providing easy navigation through content that would otherwise be inaccessible without scrolling, especially for long or dynamic content .

Frames in HTML can lead to issues with printing because each frame is treated as a separate document, which might result in incomplete or improperly formatted printouts if not all frames print correctly. To address this, web developers can provide a print-friendly version of the page that consolidates necessary content into a single document. Alternatively, embedding styles specifically for print using CSS can also help ensure that all pertinent information is included and formatted properly for printing .

The <frameset> element in an HTML document replaces the <body> element when using frames. It is specifically used to define a set of frames, dividing the browser window into different sections. Key attributes of <frameset> include 'cols' and 'rows', which specify the number and size of columns and rows, respectively. The 'border' attribute sets the width of the frame borders, 'frameborder' determines whether a three-dimensional border is shown, and 'framespacing' specifies spacing between frames .

Frames can significantly affect compatibility across devices and browsers due to several limitations. On smaller devices, the screen size might be insufficient for effectively dividing sections, leading to navigational problems or a poor viewing experience. Frames can also render inconsistently on different browsers or screen resolutions, causing layout discrepancies. Additionally, some browsers either do not support frames or handle them inadequately, further complicating compatibility and reducing the reach of framed web content .

The 'src' attribute in the <frame> element is crucial because it specifies the URL of the document that is to be loaded into the frame. This attribute directly determines what content will be displayed within a specific frame section on the page, making it essential for defining the functionality and information presented to the user .

You might also like