【问题标题】:Dynamic image loading in divdiv中的动态图像加载
【发布时间】:2020-08-11 18:57:30
【问题描述】:

现在我正在做一个 Angular 8 项目。我需要动态加载来自后端的图像。我希望将此图像加载到特定的 div 部分。我试过这个。但不工作。有人帮忙吗?

 <div class="col-md-5 box mt-4" style="background-image: url({{url}}/SupportingFiles/profile/{{institution_folder_name}}/idcards/front.jpg);">

【问题讨论】:

标签: angular angular8


【解决方案1】:

如果您使用background-image,则需要添加背景图像的heightwidth 才能正常显示。否则将无法正常工作。

 <div class="col-md-5 box mt-4" style="background-image: url({{url}}/SupportingFiles/profile/{{institution_folder_name}}/idcards/front.jpg); height: xxpx; width:xxpx">

最好添加一个类。

【讨论】:

猜你喜欢
相关资源
最近更新 更多
热门标签