我的Laravel刀片文件中有一些成员头像打印。
@foreach( $project->collaborators as $collaborator)
<div>
<span>
<img src="{{ $collaborator->user()->first()->getAvatarUrl() }}" />
{{ $collaborator->user()->first()->name}}
</span>
</div>
@endforeach
这是在我的刀片文件中垂直打印。但我需要水平打印。我怎样才能做到这一点?
尝试将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*/
}