问题总结:

1. checkbox和下面隐藏的div对齐,是在清除了默认样式的前提下,而不需要额外设置float: left;

2. 隐藏的div这里不需要专门设置宽高、居中,是靠内容和padding撑起来的尺寸。外层div居中,内层跟着居中。

<style>
    *{margin:0;padding:0;} // 后来添加的
    body{
        font-size: 12px;
    }
    #outer{
        margin: 10px auto;
        width: 180px;
    }
    /* #login input, #display{
        float: left;
    }  */
    #display{
        background-color: yellow;
        border: 1px solid orangered;
        margin-top:5px;
        padding: 5px;
        display: none;

        /* width: 180px;
        height: 30px;
        margin: 5px auto; */
    }
    </style>

 

相关文章:

  • 2022-12-23
  • 2022-01-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2021-07-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-21
  • 2021-08-18
  • 2021-10-15
  • 2022-12-23
相关资源
相似解决方案