Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我正在做这个小项目。
顶部有一个 CSS 框,所以框是浮动的。它更像是屏幕中间的一张卡片。我可以在顶部和底部看到我的背景。如何在该 css 卡的底部填充颜色?
我想用黑色填充C。而且我想在与 B 相同的班级中这样做。我不想为 C 创建单独的班级。有办法吗?有没有background-color反方向的方法?
background-color
<style> #boxC { background-color: black; } </style> <div class="classB" id="boxC"> <div>Box C</div> </div>
或者
<div class="classB" style="background-color: black"> <div>Box C</div> </div>