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