实现代码:
css样式:利用flex布局实现
body{ display: flex; justify-content: space-around; } #wrap{ width: 200px; height: 200px; background: #F0F0F0; } header{ height:28px; line-height:28px; background: #2e353d; color: white; font-size: 16px; text-align: center; } header+#content{ box-sizing: border-box; margin-top: 10px; } #content{ padding: 10px; } input,button{ width: 100%; } input[type="text"],input[type="password"]{ height: 35px; margin-top: 10px; } button{ height: 30px; margin-top: 20px; }