【发布时间】:2020-09-23 11:11:04
【问题描述】:
按照gatsby-background-imagedocumentation 中的说明,我可以通过在我的组件中包含以下内容来向组件添加全宽背景图像
<BackgroundImage fluid={backgroundImage.node.childImageSharp.fluid}>
{children}
</BackgroundImage>
这会导致以下“拉伸”背景:
但是,我不希望我的图像是组件的整个宽度。相反,我希望我的背景图像在我的组件中重复以实现以下目标:
我看到背景图像的样式是supported,但我不确定背景图像的样式是否正确以使其重复。任何帮助将不胜感激!
【问题讨论】:
-
style={{backgroundSize: '', backgroundPosition: '', backgroundRepeat: '',}}Styling & Passed Through Styles
标签: reactjs gatsby gatsby-image