Difference between div tag and frame tag

HTML frame / frameset

HTML frames - relic of old times

Frames were popular because fixed areas such as navigation, header and footer could be integrated into every website as independent files. A change in a file of the frameset was enough to change the navigation or the footer to all pages. Today, solid technologies such as PHP and content management systems, server side includes or iframes to disposal.

A frameset organizes multiple frames - either horizontally with the attribute rows or vertically with the attribute cols. Each window is created by a frame element, each frame element is a file.

Frames must be organized either in rows or in columns - a mix is ​​not possible. But since framesets can be nested within one another, complex page structures can be created.

HTML frames are no longer used today because they have serious disadvantages: They are not responsive, not suitable for the small monitors of mobile devices and are an obstacle for search engines. Anyone who as a web designer encounters websites in HTML frames today will quickly free the content from the nested framesets.

frameset markup

The frameset tag replaces the body tag. If the frameset tag is used, the body tag must definitely not be used (the iframe tag, on the other hand, may be used within a body tag).

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Frames</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> </head> <cols="*,380,*"> <src="links.html" name="links" /> <rows="*,160,*"> <src="oben.html" name="oben" /> <src="mitte.html" name="mitte" /> <src="unten.html" name="unten" /> </> <src="rechts.html" name="rechts" /> <> <body> <p>Kurzbeschreibung der Seite</p> </body> </> </> </html>

Within a frameset tag, only frame tags as well as a noframe tag and other frameset tags are permitted.

Replacement and alternatives for HTML frames

Server-side includes, or simple PHP includes, are now an efficient substitute for frames. What was previously saved in individual frames files (e.g. page header and page footer) is transferred to a file with the extension .php.

There is not a single line of PHP in the head.php, but pure HTML. Unlike frames that are loaded by the browser and put together to form a page, the HTML page is already put together on the server and delivered to the browser in one piece. Putting the individual pieces of HTML together is easier than dealing with frames.

<!DOCTYPE html> <html lang="de"> <head> <?php include("header.php"); ?> </head> <body> … <?php include("footer.php"); ?> </body> </html>

The page itself must also be saved with the file extension .php.

Server side includes are also an alternative to HTML frames. Here, too, fixed contents for the areas of the page such as the page navigation and the page footer are saved in external files. SSI files are included in the individual page

<!DOCTYPE html> <html lang="de"> <head> <!--#include virtual="head-elements.inc" --> </head> <body> <!--#include virtual="navigation.inc" --> … </body> </html>

Server side includes are also already used on the server. The official file extension for SSI websites is shtml, with an entry in the .htaccess file, however, the shtml can be replaced by html again. NGINX servers also process server side includes.

The catch of both PHP includes and SSI: They only work on the web space of a server, but not in the file system of the desktop computer. Most code editors do not display the includes accordingly.

AddType text / html .shtml AddHandler server-parsed .shtml Options Indexes FollowSymLinks Includes AddType text / html .html AddHandler server-parsed .html

To be treated with caution, because every provider has small differences in handling SSI.

Disadvantages and shortcomings

Today modern methods (PHP, Ajax, Server Side Includes, CSS positioning) are reliably available and frames are no longer used in modern web design because they have serious disadvantages:

  • There is no solution for cell phone or tablet monitors: frames are not responsive.
  • Navigating with the keyboard within the browser window is complicated: first from frame to frame, then within the frame ...
  • Printing a web page with frames also poses the question "Which frame now?"
  • Frame pages can hardly be saved using bookmarks.
  • Pages with frames can also hardly be linked with a link. The link to a page made up of frames will only reach the start page, but not the actually referenced content.
  • Search engines cannot index the content because they only reach the frameset page, which has no content. U.u. the search engine only indexes the content of the noframe element.
  • When the search engine indexes content from a frame page, the visitor gets the address of the frame, not the parent frameset page. In order for the frames page to be correctly integrated into the organization of the frameset, Javascript must almost always be used.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

Attributes for frameset

cols
Number of columns within a frameset. The specification is indirect because the current number of columns is not specified. Instead, it provides a comma-separated list of values, in which each value represents the width of a column. If there are three values ​​in the list, the frameset has three columns. The three values ​​can be specified as
  • a percentage of the width of the frame,
  • an integer number of pixels,
  • the indication of a percentage or a number of pixels plus an asterisk *.
The star assigns the space to a column that remains after the remaining frames have taken up the assigned space. The specification 3 * is three times the size of the specification *. Examples of possible information:
  • two columns:
  • three columns:
  • three columns:
  • two columns: the first with 150 pixels width, the second column with the remaining space in the frameset:
  • four columns: The second column covers 50% of the width of the frameset, the other three columns divide the remaining space equally:
rows
Number of lines within a frameset. The specification is indirect, since the current number of lines is not specified. Instead, a comma-separated list of values ​​is given, in which each value represents the height of a row. If there are three values ​​in the list, the frameset has three lines. If the attribute rows can be used cols-Attribute cannot be used. The three values ​​can be specified as
  • a percentage of the height of the frameset,
  • an integer number of pixels,
  • the indication of a percentage or a number of pixels plus an asterisk *.
The star assigns the space to a line that remains when the remaining frames have taken up the space allocated. The specification 3 * is three times the size of the specification *. Examples of possible information:
  • two lines:
  • three lines:
  • two lines: the first with a height of 150 pixels, the second with the remaining space in the frameset:
  • four lines: The second line comprises 50% of the height of the frameset, the other three lines divide the remaining space equally:

frame attributes

frameborder
puts a border around the frame or removes it. The possible values ​​are 0 or no and 1 or yes. The value of yes or 1 allows a frame to be displayed. A value of no or 0 suppresses the output of a frame.
longdesc
is the URL address of an HTML document that contains a detailed description of the frame. The attribute is intended to provide more information than the title element can display.
marginheight
sets a distance up and down between the frame and the content and is specified in pixels. If the values ​​are unrealistic, the browser ignores the attribute.
marginwidth
sets a space to the left and to the right between the frame and the content and is specified in pixels. If unrealistic values ​​are given, the browser ignores the attribute.
Surname
a string that identifies the frame. The name must be unique and can only appear once in the document.
noresize
prevents the user from changing the frame size.
scrolling
defines a horizontal and vertical scroll bar that appears in the frame. If the content is larger than the frame, it allows the visitor to scroll up and down or right and left to see all of the content. The three possible values ​​are: yes, with which it is determined that a scroll bar always appears, no, with which a scroll bar never appears, and automobilethat the scroll bar imports when it is required. If no value is given, the default is automobile.
src
specifies the URL address of an HTML, ASP, PHP or other page. The content of the referenced URL is shown in the frame.

HTML noframes

HTML noframes provides alternative content for browsers that cannot recognize or display frames - e.g. a summary of the content and links to the respective documents.

If the browser can display frames, the content of the noframes element is not displayed. But the content of the noframes tag can provide a summary of the content for the search engines.

<cols="*,380,*"> <frame src="links.html" name="links" /> <frameset rows="*,160,*"> … </frameset> <framesrc="rechts.html" name="rechts" /> <> <body> <p>Kurzbeschreibung der Seite</p> </body> </> </>

The tag must be in the first frameset tag.</p></div></div> <ul> <li><a href="https://doraprintsandpapergoods.co/?post=1004">What is utility maximization</a></li><li><a href="https://doraprintsandpapergoods.co/?post=3487">How do I personalize my YouTube feed</a></li><li><a href="https://doraprintsandpapergoods.co/?post=9270">Why are goats temperamental</a></li><li><a href="https://doraprintsandpapergoods.co/?post=8169">What are your favorite classical music composers?</a></li><li><a href="https://doraprintsandpapergoods.co/?post=2029">How does online school work</a></li><li><a href="https://doraprintsandpapergoods.co/?post=197">How to draw female body proportions</a></li><li><a href="https://doraprintsandpapergoods.co/?post=2036">What is it like to study in Mauritius?</a></li><li><a href="https://doraprintsandpapergoods.co/?post=4536">What's new in knowledge management</a></li><li><a href="https://doraprintsandpapergoods.co/?post=7961">How can I learn teaching design</a></li> </ul> </div> <div class="col-md-4"> <div class="position-sticky" style="top: 2rem;"> <div class="p-4"> <ol class="list-unstyled"> <li><a href="https://doraprintsandpapergoods.co/?post=8162">Is there an insurance for crowdfunding supporters?</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=3285">What is reactive crisis management</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=4445">How do birds slow down in flight</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=7366">How many lakes does Alaska have</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=2922">What is McDonald's Hollandaise Sauce Recipe</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=3472">What are soil plants</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=1126">How can I add flavor to alcohol?</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=8098">How do caterpillars become butterflies</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=5134">How do I become happy in loneliness</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=4475">Is there a section in AME</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=8851">How is life in Thane</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=4972">Do you feel invisible to other people?</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=674">Life is basically sad</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=9224">Can you decipher this word ADM</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=2135">What is the future of Apple's MagSafe</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=5488">How is Modi seen in Bihar</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=114">What is Spain's Favorite Supermarket</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=7591">Jay Z owns his publishing business</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=8122">What if you are poor</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=1764">What is your opinion on skin lightening</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=8412">Hates Shaq Charles Barkley</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=8891">Where can I download premium WordPress themes</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=5875">What are the most popular chat rooms</a></li> <li><a href="https://doraprintsandpapergoods.co/?post=1265">Why are narcissists often manic too?</a></li> </ol> </div> </div> </div> </div> </main> <footer class="blog-footer"> <p> <a href="#">Back to top</a> </p> </footer> </body> </html><?