Mobile page with ipad?

Source: Internet
Author: User

1.@custom-media --sm (min-width: 576px);

@custom-media --md (min-width: 768px);@custom-media --lg (min-width: 992px);@custom-media --xl (min-width: 1200px);.info-header {  @media (--md) {    width: 50%;// ipad  }  margin-left: auto;  margin-right: auto;  border-bottom: 1pxsolid#dddddd;//手机}2. Screen Fitting

Dynamically write font-size based on different screens, with REM as the width unit, fixed layout viewport.

<meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">

To 640px Design and 750px of visual manuscript, NetEase such treatment:

var width = document.documentElement.clientWidth;   // 屏幕的布局视口宽度var rem = width / 7.5;                              // 750px设计稿将布局视口分为7.5份var rem = width / 6.4;                              // 640px设计稿将布局视口分为6.4份

This way, whether it is a 750px design or 640px design, 1rem equals the 100px on the design draft. Therefore, when PX converts REM:

rem = px * 0.01;

On the 750px design draft:

75px 对应 0.75rem, 距离占设计稿的10%;在ipone6上:width = document.documentElement.clientWidth = 375px;rem = 375px / 7.5 = 50px;0.75rem = 37.5px;   (37.5/375=10%;占屏幕10%)                     在ipone5上:width = document.documentElement.clientWidth = 320px;rem = 320px / 7.5 = 42.667px;0.75rem = 32px; (32/320=10%;占屏幕10%)
3、ipone适配ipad需要设置

-(BOOL) Shouldautorotatetointerfaceorientation: (uiinterfaceorientation) interfaceorientation {

return (interfaceorientation = = uiinterfaceorientationportrait);

}

-(Nsuinteger) supportedinterfaceorientations{

return uiinterfaceorientationmaskportrait;

}

Will cause the iphone app to display on the ipad mini by default, click events, and the layout will be affected.











Mobile page with ipad?

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.