<!--
Arbitrary values
If you need to use a one-off background-image value that doesn’t make sense to include in your theme, use square brackets to generate a property on the fly using any arbitrary value.
-->
<div class="bg-[url('/img/hero-pattern.svg')]">
<!-- Your Code -->
</div>
module.exports = {
theme: {
extend: {
backgroundImage: theme => ({
'hero-pattern': "url('/img/hero-pattern.svg')",
'footer-texture': "url('/img/footer-texture.png')",
})
}
}
}
<div className="bg-[url('../public/assets/images/banner.svg')]">
// tailwind.config.js
module.exports = {
theme: {
extend: {
backgroundImage: theme => ({
+ 'hero-pattern': "url('/img/hero-pattern.svg')",
+ 'footer-texture': "url('/img/footer-texture.png')",
})
}
}
}