当前位置:网站首页>日常页码样式问题

日常页码样式问题

2020-11-09 19:54:47 易函123

问题

当页码到一千多的时候,页码的方框会非常不好看;又不能超出方框

min-width&&padding解决

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      ul {
        margin: 0;
        display: flex;
        justify-content: flex-start;
      }
      li {
        margin-right: 2px;
        list-style: none;
        padding: 0 3px;
        min-width: 24px;
        height: 24px;
        box-sizing: border-box;
        border: 1px solid #ccc;
        border-radius: 2px;
        font-size: 10px;
        text-align: center;
        line-height: 24px;
      }
    </style>
  </head>
  <body>
    <div id="main">
      <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
        <li>15</li>
        <li>15</li>
        <li>15</li>
        <li>15</li>
        <li>152</li>
        <li>152</li>
        <li>152</li>
        <li>152</li>
        <li>152</li>
        <li>152</li>
        <li>1523</li>
        <li>1532</li>
        <li>1532</li>
        <li>1532</li>
        <li>1532</li>
      </ul>
    </div>
  </body>
</html>

日常页码样式问题

版权声明
本文为[易函123]所创,转载请带上原文链接,感谢
https://segmentfault.com/a/1190000037777990