NOTES: Mobile 1-pixel thin line solution ideas

Source: Internet
Author: User

Recently has been in the Vue Mobile project, every time at the beginning to solve the problem of BORDER:1PX, referring to Daniel's article himself summarized down as a note

Reference:

Zhang Xin Xu: http://www.zhangxinxu.com/wordpress/2012/08/window-devicepixelratio/

Https://www.cnblogs.com/lunarorbitx/p/5287309.html

Cause:

in the On the Retina screen (Retina is a pixel-compressed screen that compresses more pixels into a single screen for higher resolution , which is always the other screen 2 Times ), so the 1px border is in devicepixelratio Retina on the screen will appear as 2px.

Solution:

1. Reduce the pixel value (example only takes Devicepixelratio to 2, the others are 1.5 and 3, as long as the Devicepixelratio value is multiplied by border-width equals 1)

1 . border_1px{2 Display:Block;3 width:100%;4 Border-top:1px solid Rgba (7,17,27,.1);5}6 7 @media (Min-device-pixel-ratio:2), (-webkit-min-device-pixel-ratio:2){8 . border_1px {
Display:Block;9 width:100%;Ten Border-top:0.5px Solid Rgba (7,17,27,.1);
} One}

  

  

NOTES: Mobile 1-pixel thin line solution ideas

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.