html - Laravel - 公司徽标显示在子菜单中失真
问题描述
在我的 Laravel-5.8 应用程序中,我尝试将公司徽标从文件夹加载到页面标题中:
<a href="{{ route('home') }}" class="brand-link logo-switch navbar-dark bg-gray-light">
<img src="public/storage/myLogo.png" alt="MyApp" class="brand-image-xl logo-xs">
<img src="public/storage/myLogo.png" alt="MyApp" class="brand-image-xs logo-xl" style="left: 12px">
</a>
我这样称呼它:
@include('layouts.partials.brand-logo')
我观察到在主菜单上,图像看起来不错,但在太阳菜单上显示“MyApp”。也就是说,alt
我该如何解决这个问题?
谢谢
解决方案
像这样更改您的路径以访问公用文件夹中的文件
<a href="{{ route('home') }}" class="brand-link logo-switch navbar-dark bg-gray-light">
<img src="{{asset('storage/myLogo.png')}}" alt="MyApp" class="brand-image-xl logo-xs">
<img src="{{asset('storage/myLogo.png')}}" alt="MyApp" class="brand-image-xs logo-xl" style="left: 12px">
</a>
推荐阅读
- sql-server - 当 RDLC 报告上的数据集添加时 Visual Studio 2015 崩溃并重新启动
- sql - 如何使用基于 UserAccount ID 的先前值填充 SQL Server 中的 GAP
- java - 尽管指定了正确的主类、类路径等,但 Jar 无法运行
- bash - 终端 -bash:找不到命令错误
- angular - Angular 中的 Angular Material mat-select 动态数据绑定
- c# - 从 C# 将用户定义类型的值作为输入参数传递给 Oracle 中的存储过程
- .net - ORA-01425: 转义字符必须是长度为 1 的字符串
- android - MediaPlayerNative: info/warning (10973, 0) 是什么意思?如何解决?
- hibernate - 使用 mapstruct 映射 Hibernate 实体
- java - JavaFX tableview:默认情况下,顶部单元格在编辑模式下保存来自波纹管单元格的数据