Tutorial on using the frameset tag in HTML

Tutorial on using the frameset tag in HTML

Frameset pages are somewhat different from ordinary Web pages. Although it still starts with <HTML> and the <HEAD> tag containing the title and other scripts, its content only represents the layout design of each page. Therefore, there is no need for a <BODY> element anymore, only a <frameset> tag.

Attribute Introduction
border: Sets the border thickness of the frame.

bordercolor: Sets the border color of the frame.

frameborder: Set whether to display the frame border. The setting values ​​are only 0 and 1; 0 means no border, 1 means to display the border.

cols: Splits the page vertically. There are three ways to express the value: "30%, 30 (or 30px),"; the number of values ​​represents the number of windows and the values ​​are separated by ",". "30%" means that the frame area occupies 30% of the total browser page area; "30" means that the horizontal width of the area is 30 pixels; "" means that the area occupies the remaining page space. For example: cols="25%,200,*" means that the page is divided into three parts, the left part occupies 25% of the page, the horizontal width of the middle is 200 pixels, and the rest of the page is the right part.

rows: Divide the page horizontally. The numerical representation method and meaning are the same as cols.

framespacing: Set the blank space reserved between frames.

usage
Let’s take a look at this code:

XML/HTML CodeCopy content to clipboard
  1. < frameset   rows = "*"   cols = "180,*"   frameborder = 0   border = 0   >   
  2.   < frame   src = "left.html"   scrolling = "no" noresize > </ frame >   
  3.          < frame   src = "main.html"   name = "main" > </ frame >   
  4. </frameset>   

This code means: a two-column frameset is set, the width of the left column is 180px, and noresize means the width remains fixed.

So, how do you use frame navigation to jump to a specified section? The following code is the navigation frame on the left:

XML/HTML CodeCopy content to clipboard
  1. < html >   
  2.   < head >   
  3.    < meta   charset = "utf-8" >   
  4.   </ head >   
  5.   < body   bgcolor = "#ffffd2" >   
  6.    < ul >   
  7.   < li > < a   href = "./reg.html"   target = "main" > Register User </ a > </ li >   
  8.   < li > < a   href = "./main.html"   target = "main" > Back to Home Page </ a > </ li >   
  9.    < ul >   
  10.   </ body >   
  11. </ html >   

These links target the second frame. The second frame displays the linked document. A navigation frame in which links point to specified sections in the target file.

Let’s take a closer look at this example:

XML/HTML CodeCopy content to clipboard
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >   
  2. < html   xmlns = "http://www.w3.org/1999/xhtml"   xml:lang = "en" >   
  3.   
  4. < head >   
  5.      < meta   http-equiv = "Content-Type"   content = "text/html; charset=UTF-8" >   
  6.      < title > haorooms blog frame standard demo </ title >   
  7. </ head >   
  8.   
  9. < frameset   row = "180,*" >   
  10.      < frame   name = "topFrame"   src = "topframe.html"   />   
  11.      < frameset   cols = "50%,50%" >   
  12.          < frame   src = "left.html"   name = "leftFrame"   />   
  13.          < frame   src = "right.html"   name = "rightFrame"   />   
  14.   
  15.      </frameset>   
  16.   
  17. </frameset>   
  18.   
  19. </ html >   

The layout and the effects of each part of the selection area using js are as follows:
2016530120259070.png (799×559)

<<:  JavaScript form validation example

>>:  How to use Portainer to build a visual interface for Docker

Recommend

Introduction to the usage of common XHTML tags

There are many tags in XHTML, but only a few are ...

Example code for implementing the wavy water ball effect using CSS

Today I learned a new CSS special effect, the wav...

How to implement Docker volume mounting

The creation of the simplest hello world output i...

Linux kernel device driver kernel debugging technical notes collation

/****************** * Kernel debugging technology...

A brief discussion on the role of Vue3 defineComponent

Table of contents defineComponent overload functi...

When should a website place ads?

I recently discussed "advertising" with...

Summary of common docker commands

Docker installation 1. Requirements: Linux kernel...

MySQL InnoDB monitoring (system layer, database layer)

MySQL InnoDB monitoring (system layer, database l...

Linux common text processing commands and vim text editor

Today, let's introduce several common text pr...

Summary of common tool functions necessary for front-end development

1. Time formatting and other methods It is recomm...

Linux file systems explained: ext4 and beyond

Today I will take you through the history of ext4...

Website front-end performance optimization: JavaScript and CSS

I have read an article written by the Yahoo team ...

Summary of some practical little magic in Vue practice

How can you forget lazy loading of routes that al...

How to find and delete duplicate records in MySQL

Hello everyone, I am Tony, a teacher who only tal...

Detailed explanation of JavaScript Promise and Async/Await

Table of contents Overview Four examples Example ...