css虚线
代码:
1 <!DOCTYPE html> 2 <html lang="en"> 3 4 <head> 5 <meta charset="UTF-8"> 6 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 7 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 8 <title>虚线</title> 9 <style> 10 .line { 11 background: -webkit-linear-gradient(to left, transparent 0%, transparent 50%, #D0D7E6 50%, #D0D7E6 100%); 12 background: -moz-linear-gradient(to left, transparent 0%, transparent 50%, #D0D7E6 50%, #D0D7E6 100%); 13 background: -o-linear-gradient(to left, transparent 0%, transparent 50%, #D0D7E6 50%, #D0D7E6 100%); 14 background: -ms-linear-gradient(to left, transparent 0%, transparent 50%, #D0D7E6 50%, #D0D7E6 100%); 15 background: linear-gradient(to left, transparent 0%, transparent 50%, #D0D7E6 50%, #D0D7E6 100%); 16 background-size: 20px 2px; 17 background-repeat: repeat-x; 18 padding: 10px; 19 } 20 </style> 21 </head> 22 23 <body> 24 <div class="box line"> </div> 25 </body> 26 27 </html>