|
|

楼主 |
发表于 2024-6-17 19:37
|
显示全部楼层
你可以做实验的:
<style>
#mydiv { margin: 20px auto; width: 600px; height: 300px; border: 1px solid plum; position: relative; }
#mydiv::before, #mydiv::after { position: absolute; right: 0; width: 100%; height: 100%; }
#mydiv::before { content: 'before'; background: pink; }
#mydiv::after { content: 'after'; background: lightblue; width: 60%; }
#son { position: absolute; bottom: 0; width: 100%; height: 60%; background: olive; }
</style>
<div id="mydiv">
<div id="son">son</div>
</div> |
|