我尝试简单地添加一个背景图像,但我猜路径是错误的。我尝试改变路径,但没有一个工作。我错过了什么吗?
我的HTML:
<div class="w-1/3 flex flex-col p-2 bg-wave rounded-md m-2 mb-2">
<!--some code here-->
</div>
我的tailwind.config.js
文件:
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./components/**/*.{html,js}',
'./pages/**/*.{html,js}',
'./index.html',
'./src/**/*.js',
],
theme: {
extend: {
backgroundImage:{
'wave':"url:('..public/waves.png')"
}
},
},
plugins: [],
}
我的结构:
public
output.css
waves.png
index.html
tailwind.config.js
1条答案
按热度按时间bqjvbblv1#
您应该将
url:('..public/waves.png')
更改为url:('/public/waves.png')
。