Adaptable to different size browsers--fixed shifts

Source: Internet
Author: User

This article is about narrowing the browser, scheduling does not change with the size of the browser window, if you need to schedule changes with the browser, the use of bootstrap will be better, today is to introduce fixed scheduling

Add JS Code:

<script language= "JavaScript" >functionReadypage () {if(Screen.width >= 1600){                $(". Content_container"). Width (1600); }             Else if((screen.width >= 1400) && (Screen.width < 1600)){                $(". Content_container"). Width (1400);//The action you need at this resolution            }               Else if((Screen.width >=) && (Screen.width < 1400)){                $(". Content_container"). Width (1024);//The action you need at this resolution            }                           Else if((screen.width >= 980) && (Screen.width < 1024)){                $(". Content_container"). Width (980);//The action you need at this resolution            }                          Else {                $(". Content_container"). Width (800);//at this resolution you operate            }        }    </script>
View Code

Then in the body, introduce JS, add code: onload= "Readypage ()"

There is another way, when the browser shrinks, the schedule does not change as he shrinks, but the current attempt, is able to do, on this machine full-screen display Oh, on other machines, you may need to drag the progress bar to see full screen.

Content is what we need to show and add a parent div before the content, as follows:

<div class= "Container" >

<div class= "Screenadaptive" >

Content

</div>

</div>

The width of the container is handled as follows:

. container {

width:100%;

height:100%;

margin:0 Auto;

}

For the parent of content, specify the width:

. screenadaptive{

width:1600px;

height:100%;

}

This method has limitations, and later if there is a good way to update again.

Adaptable to different size browsers--fixed shifts

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.