Mobile 1px Solutions

Source: Internet
Author: User

The front-end students must have encountered the problem of 1px frame, in the high-split screen mobile phone, we will find that they write 1px tend to be more than expected "coarse" some, the following is a summary of the solution for others.

Single

Write a line with a height of 1px and then zoom through Transform:scaley (0.5) to achieve

1 Div {2    height:1px;  3    background:#ddd;  4    -webkit-transform: ScaleY (0.5);  5    -webkit-transform-origin:0 0;  6    overflow: hidden;  7 }
Borders + rounded Corners

And the above ideas are the same, but also by zooming in and then narrowing the implementation, it is important to note that the width and the fillet to be set to twice times the original

1 Div{2 position:relative;3}4 Div:before{5 content: "";6 position:Absolute;7 Top:0;8  Left:0;9 width:200%;/*Wide Zoom*/Ten Height:200%; One Border:Solid 1px #ddd; A Border-radius:10px;/*rounded corners to enlarge*/ - Overflow:Hidden; - Transform-origin:0 0; the -webkit-transform-origin:0 0; - Transform:Scale (0.5, 0.5); - -webkit-transform:Scale (0.5, 0.5); -}

Source Address:

1PX Solutions

Reference Link: http://www.cnblogs.com/shuiyi/p/5568348.html

Mobile 1px Solutions

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.