gpt4 book ai didi

html - 如何使 div 组的背景颜色更宽?

转载 作者:太空宇宙 更新时间:2023-11-04 09:11:44 25 4
gpt4 key购买 nike

我希望 div 的背景颜色超过最小尺寸。在每个方向多说 10px。

使用 flexBox 我得到以下结果:https://gyazo.com/815fcc78086c81cdc46b758c9230e9b9

我的尝试是为 div 添加边框,然后将其设为相同的颜色以模拟扩展。看看我在哪里有边境属性(property)?这就是尝试。

.volunteer, .organization {
display: flex;
color: rgb(193,193,193);
background-color: rgba(1,48,87,.9);
border: 15px, solid, rgba(255,48,87,.9);
justify-content: center;
flex-direction: column;
margin: 5%;
}

有没有办法做到这一点?我看到的唯一其他方法是在 photoshop 中制作背景,但这看起来太额外了。

最佳答案

你要找的是padding。您可以简单地添加这一行:

padding: 10px;

并根据需要调整数字。

关于html - 如何使 div 组的背景颜色更宽?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42079552/

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