chrome,ff浏览器默认行高

chrome,ff浏览器默认行高不同,需要初始化。

chrome下是16px  ff是18px

设置不同行高,auto、18px 16px

 1 <!doctype html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>Document</title>
 6     <style>
 7     ul,li{
 8         margin: 0;
 9         padding: 0;
10     }
11     h6{
12         font-size: 16px;
13         border-bottom: 1px solid #ccc;
14         margin: 10px 0;
15         height: 18px;
16         line-height: auto;/* 18px,16px */
17     }
18     ul{ overflow: hidden;}
19     li{
20         border: 1px solid #ccc;
21         border-bottom: none;
22         z-index: 103;
23         font-size: 14px;
24         float: left;
25         list-style: none;
26         margin-right: 20px;
27         padding: 10px;
28     }
29     </style>
30 </head>
31 <body>
32     <h6>前端之路<ul >
33                         <li ><a href="#">我的前端之路</a></li>
34                         <li ><a href="#">我对前端的理解</a></li>
35                         <li ><a href="#">有趣的标签</a></li>
36                         <li ><a href="#">奇怪的问题</a></li>
37                     </ul></h6>
38 </body>
39 </html>
原文地址:https://www.cnblogs.com/snowinmay/p/3073937.html