gpt4 book ai didi

css - Bootstrap 选项卡 : Background image inside tag not streching to 100%

转载 作者:行者123 更新时间:2023-11-28 05:47:11 26 4
gpt4 key购买 nike

我为 Bootstrap Tab 设置了背景图像,但图像位于中心,没有覆盖整个 Tab。我尝试将 backgroundSize 用作 100%、cover、auto 等,但没有用。我希望粉红色图像覆盖整个选项卡。请帮忙

image

let tabStyle1 = {
display: 'inline-block',
width: 12,
height: 15,
backgroundColor: '#FF00FF', // added to check the issue
backgroundImage: 'url(' + filename + ') ',
backgroundRepeat: 'no-repeat',
backgroundPosition: '-0px -10px',
backgroundSize: '15px 300px'
};
let tab1 = <img src={"./international-emoji/blank.gif"} style={ tabStyle1 }/>
<Tabs defaultActiveKey={1}>

<Tab eventKey={1} title={tab1}>
<ul className="list-panel">
...
</ul>
</Tab>

最佳答案

当我们在 CSS 文件或样式上附加背景时,我们需要在该标签上提供适当的宽度和高度或所需的宽度和高度

关于css - Bootstrap 选项卡 : Background image inside tag not streching to 100%,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37539750/

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