About the size of the font on the mobile side

Source: Internet
Author: User

First, font-family use sans serif font
Body {    font-family: "Helvetica Neue", Helvetica, Stheiti, Sans-serif;}
    • iOS 4.0+ uses English fonts Helvetica Neue, before the iOS version is degraded using Helvetica

    • Chinese font set to Chinese blackbody stheiti

    • The default digital font is Helvetica Neue

It should be added that the Chinese blackbody does not exist in the iOS font library (http://support.apple.com/kb/HT5878), but the system will automatically hit the Chinese blackbody Stheiti compatible with the system default English font Blackbody-Simple or bold-complex

Heiti SC Light blackbody-Jencine (obsolete after IOS 7)
Heiti SC Medium blackbody-Simplified Chinese Black
Heiti TC Light blackbody-complex fine body
Heiti TC Medium blackbody-Black

Native Android Chinese fonts and English fonts are selected by default sans serif font

    • 4.0 before the version of English and digital fonts native Android uses the droid Sans, Chinese fonts native Android will hit the droid Sans Fallback

    • After 4.0, both Chinese and English fonts will use the native Android new Roboto font

    • Other third-party Android systems also consistently select the default sans serif font

Conclusion
    • Each phone system has its own default font, and does not support Microsoft Black

    • No need to define Chinese font for mobile phone without special requirement, use system default

    • English fonts and digital fonts can be used Helvetica, three kinds of systems are supported

/* Code */body{font-family:helvetica for the mobile-defined font;}
Ii. what is font-size1 and REM?

REM (font size of the root element) refers to the unit of font size relative to the root element. Simply put, it is a relative unit. See REM Everyone will think of EM units, EM (font size of the element) is the unit relative to the font size of the parent element. They are very similar, except that a calculated rule is dependent on the root element one is dependent on the parent element calculation.

2. Use Set viewport to zoom

Many of the Web apps are done this way, with a 320-width benchmark, scaling up to 320*1.3 = 416, and the basic zoom to 416 compatible with the Iphone6 plus screen, which is simple, crude and efficient. But some students use the process of reaction scaling will cause some page elements will paste the situation

3. REM Adaptation
html{    font-size:20px;}. btn {    width:6rem;    Height:3rem;    Line-height:3rem;    Font-size:1.2rem;    Display:inline-block;    Background: #06c;    Color: #fff;    Border-radius:. 5rem;    Text-decoration:none;    Text-align:center;    }

In this case: 20px = 1rem at the root element (Font-size = 20px)

The General standard

4, the use of media query settings can also be used to achieve a suitable
HTML {    font-size:20px;} @media only screen and (min-width:401px) {    html {        font-size:25px!important;    }} @media only screen and (min-width:428px) {    html {        font-size:26.75px!important;    }} @media only screen and (min-width:481px) {    html {        font-size:30px!important;     }} @media only screen and (MIN-WIDTH:569PX) {    html {        font-size:35px!important;     }} @media only screen and (min-width:641px) {    html {        font-size:40px!important;     }}
Third, the picture adaptive

Just finished with the REM layout, the same effect can be achieved with a percent layout, but with a percentage layout, you have to face a problem: picture width 100%, there is a high level of collapse when the page loads. .

Padding-top = (Image height/image Width) * 100%

Principle: When the Padding-top value is a percentage, the value is relative to the width of the

. cover{position:relative; padding-top:100%; height:0; overflow:hidden;}. Cover img{position:absolute; top:0; width:100%;}

  

Reference articles

Https://developer.mozilla.org/zh-CN/docs/Web/Guide/CSS/Media_queries

Https://isux.tencent.com/web-app-rem.html

http://www.ghugo.com/mobile-h5-fluid-layout-for-iphone6/

http://alloyteam.github.io/Spirit/modules/Standard/

            

The size of the font on the mobile side

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.