search
HomeWeb Front-endHTML TutorialAnalysis on the use of frameset tag, frame tag and iframe tag


#frame is knowledge that must be mastered in web development. For example, backgroundarchitecture, partial refresh, and page segmentation are all uses of frames, especially for background page production. Using frames will give users a very comfortable experience.

frame knowledge points include (frameset tag, frame tag, iframe tag).

## 1. frameset

##1. Attributes

①border

Set the border thickness of the frame.

②bordercolor

##Set 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

Split the page vertically. There are three numerical representation methods: "30%, 30 (or 30px), *"; the number of values ​​represents the number of divided windows and the values ​​are separated by ",". "30%" means that the frame area occupies 30% of the entire 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,*" It means dividing the page into three parts, with the left part accounting for 30% of the page, the middle horizontal width being 200 pixels, and the rest of the page being the right part.

⑤rows

Split the page horizontally. The numerical representation method and meaning are the same as cols.


##⑥framespacing

##Setting frames and frames The remaining white space between them.

##2. Use case

Note 1:

cols and rows attributes should not be in the same used in labels. To implement the architecture below, the correct way to write the code is:


#

##

## < ;frameset cols="213,*" frameborder="no" border="0" framespacing="0">

##

## 

##[That is, if you want to use both cols and rows, you can use Frameset nested implementation】

Note 2:

means: the first frame occupies the entire browser 40% of the window, the remaining space is evenly divided between the other two frames.

#


means: the browser window is divided into four equal parts.

## 2. frame

1. Properties

##①name


Set the frame name. This property must be set.

②src

Set the name or path of the web page to be displayed by this frame. This property must be set.

##③scrolling


Set whether to display scroll bars. The setting values ​​are auto, yes, no.

④bordercolor


##Set the border of the frame color.

⑤frameborder


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

⑥noresize


##Set the frame size whether Can be adjusted manually.

⑦marginwidth

Set the width between the frame border and the content within it.

⑧marginhight

Sets the height between the frame boundary and the content within it.

⑨width

Set the frame width.

⑩height

Set the frame height.

2. Use case##

3. iframe

is a floating frame (frame), its common attributes are similar to frame, the other main ones are as follows (the same ones will not be listed)

1. Properties

①align

Set vertical Or horizontal alignment

②allowTransparency

Set or get

Object

Whether it can be transparent.

2. Use case

##Note:

The verification method of iframe tag is different from frameset and frame tag, it is XHTML 1.0 Transitional. And iframe is placed within the body tag, while frameset and frame are placed outside the body tag.

##4. Comprehensive example

##

Comprehensive example

##

##

##

##<span style="font-family:Microsoft YaHei"></span>

##

Sorry, your browser does not support "frames"!

##

#> ;

##[Explanation]

## flag pair is also placed flag pairs, used to display text or image information in browsers that do not support frames. This pair of tags is immediately followed by the pair of tags before any of the familiar tags can be used.

##One final point needs to be made:

If you write the code into VS as I wrote above and report an error, for example:


##or


#The solution is as follows :

Tools→Options→Text Editor→HTML→Verification→Internet Explorer 6.0

Okay, through the above content, if you practice more, you will gradually become familiar with the frame If you use it well, you will find that it is really good. As for the Event method of the frame series tag, it is generally not used very much. If necessary, you can check it yourself. [Haha, actually I haven’t used it yet]

The above is the detailed content of Analysis on the use of frameset tag, frame tag and iframe tag. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Why are HTML tags important for web development?Why are HTML tags important for web development?May 02, 2025 am 12:03 AM

HTMLtagsareessentialforwebdevelopmentastheystructureandenhancewebpages.1)Theydefinelayout,semantics,andinteractivity.2)SemantictagsimproveaccessibilityandSEO.3)Properuseoftagscanoptimizeperformanceandensurecross-browsercompatibility.

Explain the importance of using consistent coding style for HTML tags and attributes.Explain the importance of using consistent coding style for HTML tags and attributes.May 01, 2025 am 12:01 AM

A consistent HTML encoding style is important because it improves the readability, maintainability and efficiency of the code. 1) Use lowercase tags and attributes, 2) Keep consistent indentation, 3) Select and stick to single or double quotes, 4) Avoid mixing different styles in projects, 5) Use automation tools such as Prettier or ESLint to ensure consistency in styles.

How to implement multi-project carousel in Bootstrap 4?How to implement multi-project carousel in Bootstrap 4?Apr 30, 2025 pm 03:24 PM

Solution to implement multi-project carousel in Bootstrap4 Implementing multi-project carousel in Bootstrap4 is not an easy task. Although Bootstrap...

How does deepseek official website achieve the effect of penetrating mouse scroll event?How does deepseek official website achieve the effect of penetrating mouse scroll event?Apr 30, 2025 pm 03:21 PM

How to achieve the effect of mouse scrolling event penetration? When we browse the web, we often encounter some special interaction designs. For example, on deepseek official website, �...

How to modify the playback control style of HTML videoHow to modify the playback control style of HTML videoApr 30, 2025 pm 03:18 PM

The default playback control style of HTML video cannot be modified directly through CSS. 1. Create custom controls using JavaScript. 2. Beautify these controls through CSS. 3. Consider compatibility, user experience and performance, using libraries such as Video.js or Plyr can simplify the process.

What problems will be caused by using native select on your phone?What problems will be caused by using native select on your phone?Apr 30, 2025 pm 03:15 PM

Potential problems with using native select on mobile phones When developing mobile applications, we often encounter the need for selecting boxes. Normally, developers...

What are the disadvantages of using native select on your phone?What are the disadvantages of using native select on your phone?Apr 30, 2025 pm 03:12 PM

What are the disadvantages of using native select on your phone? When developing applications on mobile devices, it is very important to choose the right UI components. Many developers...

How to optimize collision handling of third-person roaming in a room using Three.js and Octree?How to optimize collision handling of third-person roaming in a room using Three.js and Octree?Apr 30, 2025 pm 03:09 PM

Use Three.js and Octree to optimize collision handling of third-person roaming in the room. Use Octree in Three.js to implement third-person roaming in the room and add collisions...

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft