酷代码 AI
菜单
全部AI  /  热门  /  AI写代码神器
服务商

公园里需要种五棵树,一共五棵,背景图片“bg.png”位于窗体的中心,树的图片为“tree.png”,左侧第一棵树的位置为(100,200)树与树的间距为150

```css #park { background-image: url('bg.png'); background-position: center; background-size: cover; width: 100%; height: 100vh; position: relative; } .tree { width: 100px; /* 树的宽度 */ height: 150px; /* 树的高度 */ background-image: url('tree.png'); background-size: cover; position: absolute; } .tree1 { left: 100px; top: 200px; } .tree2 { left: 250px; top: 200px; } .tree3 { left: 400px; top: 200px; } .tree4 { left: 550px; top: 200px; } .tree5 { left: 700px; top: 200px; } ``` ```html <div id="park"> <div class="tree tree1"></div> <div class="tree tree2"></div> <div class="tree tree3"></div> <div class="tree tree4"></div> <div class="tree tree5"></div> </div> ``` [2024-10-03 19:44:51 | AI写代码神器 | 494点数解答]

相关提问