- 「实现居中」也是一道必考题
- 参考代码:
<style>
.wp {
border: 1px solid red;
width: 300px;
height: 300px;
}
.box {
background: green;
}
.box.fixed-size {
width: 100px;
height: 100px;
}
</style>
<body>
<div class="wp">
<div class="box fixed-size">text</div>
</div>
</body>
2024年8月13日大约 2 分钟...