Pure CSS for iframe wide-height adaptive

Source: Internet
Author: User
Tags wrapper

Find things from the internet, found that they are not suitable for their own requirements, but also a pure CSS implementation, too lazy to see, most of the time is based on JS, of course, my idea is to not use JS (this is a personal quirk, in fact, JS is nothing, after all, now more than 99% of browsers support JS). Then slowed down their own footsteps, study it yourself. Of course, this is not the most perfect, as to where is not perfect, the final will be given. This gives the code first.

<!doctype html>

A lot of things on the internet just give a solution, do not indicate what to solve, although the general is said, but the details of the better to express. What I'm going to achieve here is an IFRAME in the lower right corner, a wide-height adaptive situation. As to what is the bottom right corner, did the website art of all understand, the general site backstage, are either in the bottom left, or in the lower right to show the main content.

Some students will say that the width of the IFRAME set to 100% not on the line. If there is only one iframe inside your body, it will work, but it seems like no one is using it. Our IFRAME is inside a box, not directly inside the body.

So the first thing to achieve is that the bounding box of the IFRAME is as you drag the browser border and adaptive change, here I use Position:absolute to achieve, of course, you can also use other methods, I have not used, but I think it should be possible. Here to explain the wrapper inside the properties, top, left, bottom, right is to let wraper with the browser and change, why there is a padding-top is to solve the IE6 problem, as to why the IE6 will appear this situation, I do not know.

Then is in the box Nega iframe, so I added an iframe, tried, can, but IE6 again problem, width became very wide, so I was in the iframe outside added a layer, just to solve the problem. I hate IE6, but in China, we are always using something that is far behind others and not consciously.

--http://www.phpabc.cn/chun-css-shi-xian-iframe-kuan-gao-zi-shi-ying.html

Related Article

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.