Laravel 8 背景照片没有出现
Laravel 8 Background photo does't appear
<div class="site-blocks-cover overlay bg-light" style=" background-image: url('public/template/images/hero_bg_1.jpg')" id="home-section">
照片没有出现在 website.Also 我没有收到任何错误
the website
尝试使用 Laravel
的 url
函数
background-image:url({{url('template/images/hero_bg_1.jpg')}})
您必须添加 {{url(' ')}} 以呼应您的图像
所以你的代码必须是
<div class="site-blocks-cover overlay bg-light" style=" background-image: url('{{url('public/template/images/hero_bg_1.jpg')}}')" id="home-section">
还有一个你可以使用它的asset()
像这样
<div class="site-blocks-cover overlay bg-light" style=" background-image: url('{{asset('public/template/images/hero_bg_1.jpg')}}')" id="home-section">
<div class="site-blocks-cover overlay bg-light" style=" background-image: url('public/template/images/hero_bg_1.jpg')" id="home-section">
照片没有出现在 website.Also 我没有收到任何错误 the website
尝试使用 Laravel
的url
函数
background-image:url({{url('template/images/hero_bg_1.jpg')}})
您必须添加 {{url(' ')}} 以呼应您的图像 所以你的代码必须是
<div class="site-blocks-cover overlay bg-light" style=" background-image: url('{{url('public/template/images/hero_bg_1.jpg')}}')" id="home-section">
还有一个你可以使用它的asset() 像这样
<div class="site-blocks-cover overlay bg-light" style=" background-image: url('{{asset('public/template/images/hero_bg_1.jpg')}}')" id="home-section">