Php 后端:是否可以从数据库中获取css背景(url)中的图像位置?

Php 后端:是否可以从数据库中获取css背景(url)中的图像位置?,php,css,laravel,Php,Css,Laravel,我已经把我的数据扔到刀刃上了。我正在使用内联css。在这种情况下,我需要background:url(..)而不是。在浏览器上,当我在新文件中检查并打开img时,它会打开,但css无法解析和显示它。我应该给它更多的位置吗 目前,我正在尝试这个 <div class="row profile-cover" style="margin: 0; background: url('{{$userDetails->profile_img}}')"> 你可以写这个。希望这能解决你的问题

我已经把我的数据扔到刀刃上了。我正在使用内联css。在这种情况下,我需要
background:url(..)
而不是
。在浏览器上,当我在新文件中检查并打开img时,它会打开,但css无法解析和显示它。我应该给它更多的位置吗

目前,我正在尝试这个

<div class="row profile-cover" style="margin: 0; 
background: url('{{$userDetails->profile_img}}')">

你可以写这个。希望这能解决你的问题

<div class="row profile-cover" style="margin: 0; background: url({{ asset($userDetails->profile_img) }})">



在我添加资产时请阅读此内容。。我只得到背景:url()。。我不知道我的路径为什么?@ReyYoung检查数据库中的图像和图像字段是否为空
<div class="row profile-cover" style="margin: 0; background: url({{ asset($userDetails->profile_img) }})">
<div class="row profile-cover" style="margin: 0; background-image: url({{ asset($userDetails->profile_img) }})">