1px border exception is often found on the mobile side of the coarse, therefore, decided to use Pseudo-class with CSS3 to achieve a 0.5px border
The code is as follows:
1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 <Head>4 <Metacontent= "Width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"name= "Viewport">5 <MetaCharSet= "UTF-8">6 <title>0.5 border</title>7 <styletype= "Text/css">8 *{margin:0;padding:0;-webkit-box-sizing:Border-box;}9 ul{Ten position:relative; One } A Li{ - Height:60px; - Line-height:60px; the Padding-left:10px; - position:relative; - font-size:20px; - } + Li:after{ - content: ""; + Display:Block; A position:Absolute; at Left:-50%; - width:200%; - Height:1px; - background:#ededed; - -webkit-transform:Scale (0.5); - } in </style> - </Head> to <Body> + <ul> - <Li>List-item1</Li> the <Li>List-item2</Li> * <Li>List-item3</Li> $ <Li>List-item4</Li>Panax Notoginseng <Li>List-item5</Li> - <Li>List-item6</Li> the <Li>List-item7</Li> + <Li>List-item8</Li> A </ul> the </Body> + </HTML>
The main idea is to use pseudo-class to achieve border, first zoom in one times, and then use CSS3 to reduce by one times. Then set the position to the correct location.
Implementation of 0.5px border on mobile page