Solutions for gaps between the iframe framework or web page and the browser

Source: Internet
Author: User

 

As shown in the preceding figure, an iframe framework is processed today, and the old problem occurs again. There is a big gap between the browser Edge and the browser! Both under IE6 and Chrome, this is a phenomenon I have encountered many times before, but I am not more engaged in code, I can't remember.

Solution: add the parameter leftmargin = "0 & Prime; topmargin =" 0 & Prime; to the body of the webpage. This parameter is only part of the body!

For example:

<Body leftmargin = "0" topmargin = "0">  </body>

In this way, there will be no gap between the browser and the webpage, and it will become more enriched! The effect is as follows:

 

Note: 1 is the effect of no spacing, and 2 is the white edge that comes with the image!

Next I will repeat the iframe code that I always forget:

<Iframe src = "http://www.111cn.net/" frameBorder = 0 scrolling = no width =" 100% "height =" 2930px "style =" margin-top: 0px; margin: 0px; padding: 0px "> </iframe>

Parameters:

Iframe is used to set floating text boxes or containers for text or graphics.

Scrolling usage: <iframe src = "http://xxx.xx"> </iframe>

Function: whether a scroll bar is displayed ("auto" is automatic, "yes" is displayed, and "no" is not displayed)

Border usage: <iframe border = "3 & Prime;> </iframe>

Function: set the edge width around the text box.

Frameboder usage: <iframe frameboder = "0 & Prime;> </iframe>

Function: set whether the border is set to 3 dimensions (0 = no, 1 = yes)

Height and width usage: <iframe height = "31 & Prime; width =" 88 & Prime;> </iframe>

Function: sets the border width and height.

Scrolling usage: <iframe scrolling = "no"> </iframe>

Function: whether a scroll bar (yes, no, auto) exists)

Src usage: <iframe src?”girl.gif "> </iframe>

Function: specify the files or images (html, htm, gif, jpeg, jpg, png, txt, *. *) called by iframe ,*.*)

Iframe can be embedded in any part of the webpage. Its attributes can also be: name (Framework name) and marginwidth (left and right margins of text within the frame), marginheight (margin of intra-frame text), style (embedded document style, set iframe style), allowtransparency (whether to allow transparency)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.