Page border:1px display on the mobile side

Source: Internet
Author: User

Before solving this problem, first to understand the concept of mobile front-end development viewport, wrote a very rough viewport detailed article on it has a very simple understanding. Here is a very detailed blog post << Mobile front-end development Viewport Insight > >

Go straight to the code to solve the border:1px solution

1 <!DOCTYPE HTML>2 <HTML>3 <Head>4     <MetaCharSet= "Utf-8" />5     <Metaname= "Viewport"content= "Width=device-width, initial-scale=1.0, maximum-scale=1.0, User-scalable=no" />6     <title>Pixel is 1px</title>7     <styletype= "Text/css">8 . Border{position:relative;Margin-bottom:20px;}9 . Border:after{content:"';Display:Block;position:Absolute;width:100%; Left:0px;Bottom:0px;Height:1px;Background-color:#ccc;-webkit-transform:ScaleY (0.5);Transform:ScaleY (0.5);}Ten  One . Border2{background:-webkit-gradient (linear, left top, left bottom, color-stop (. 5, transparent), Color-stop (. 5, #ccc), to (#ccc)) left bot Tom Repeat-x;background-size:100% 1px; } A     </style> - </Head> - <Body> the     <Divclass= "Border">Pixel is 1px solution one</Div> -  -     <Divclass= "Border2">Pixel is 1px solution two</Div> - </Body> + </HTML>

2 options are CSS3 to solve. The first is to scale through the elements, and the second is a linear gradient method that can only be seen on the phone.

Page border:1px display 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.