1、快标签自身水平居中:

当一个有宽度的块标签设置margin:0 auto时将实现自身的水平居中,示例脚本如下

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>float</title>
        <style type="text/css">
            #container {
                margin: 0 auto;
                width: 90%;
                background: lightblue;
                height: 200px;
            }
        </style>
    </head>
    <body>
        <div id="container">
        </div>
    </body>
</html>
View Code

相关文章:

  • 2022-12-23
  • 2021-08-17
  • 2021-04-10
  • 2022-01-12
  • 2021-12-09
  • 2021-11-05
  • 2022-02-25
  • 2022-12-23
猜你喜欢
  • 2022-01-09
  • 2022-01-22
  • 2021-12-12
  • 2021-12-12
  • 2021-10-09
相关资源
相似解决方案