How to do this on a Box in Chakra UI? #2173
-
How would I set a backgroundImage like this in ChakraUI?
The prop has no effect. The images are coming from the Unsplash API and the url look like this https://images.unsplash.com/photo-1601906406089-24e31e0ea77a?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE3MTgyM30 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
can you clarify which prop has no effect, and could you provide a codesandbox? using |
Beta Was this translation helpful? Give feedback.
-
I think you should wrap it a the <Box
css={{
background: `url(images/bg.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;`
}}
/> |
Beta Was this translation helpful? Give feedback.
can you clarify which prop has no effect, and could you provide a codesandbox? using
background
should do that, there's no need for-webkit-background-size
etc.