【问题标题】:how to print Horizontaly My project members avatar in laravel blade file?如何在laravel刀片文件中打印我的项目成员头像?
【发布时间】:2018-06-01 16:23:32
【问题描述】:
我的 Laravel 刀片文件中有一些成员头像打印。
@foreach( $project->collaborators as $collaborator)
<div>
<span>
<img src="{{ $collaborator->user()->first()->getAvatarUrl() }}" />
{{ $collaborator->user()->first()->name}}
</span>
</div>
@endforeach
这是在我的刀片文件中垂直打印的。但我需要水平打印。我该怎么做?
【问题讨论】:
标签:
php
css
html
laravel-5
【解决方案1】:
尝试将 div 显示方式改为内联,而不是默认块:
@foreach( $project->collaborators as $collaborator)
<div class="collaborator">
<span>
<img src="{{ $collaborator->user()->first()->getAvatarUrl() }}" />
{{ $collaborator->user()->first()->name}}
</span>
</div>
@endforeach
在css中:
.collaborator {
display: inline;
/*width: 200px; probably you'll need to set the width*/
}