gpt4 book ai didi

html - CSS多重背景

转载 作者:太空宇宙 更新时间:2023-11-04 05:32:19 29 4
gpt4 key购买 nike

我有一个网站,我想更改它的背景。我想在顶部和底部放置一个背景。

这是CSS代码:

div.bg_top {  background-image: url('bg_top.jpg');  background-repeat: no-repeat;  background position: top center;}div.bg_bottom {  background-image: url('bg_bottom.jpg');  background-repeat: no-repeat;  background position: bottom center;}

HTML代码:

<div class="bg_top">  <div class="bg_bottom">    Content Here.  </div></div>

对吗?

最佳答案

我建议最好使用 CSS 速记

.bg_top { background: url('bg_top.jpg') no-repeat top center; }

.bg_bottom { background: url('bg_bottom.jpg') no-repeat bottom center; }

关于html - CSS多重背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2475088/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com