你好,我有视图显示是汽车的显示项目我想在我使用时组织显示的文本class="text-center"
是将项目移动到中心但没有像我想要的那样组织。查看我的附件
这是代码
<div class="container" style= "word-break: break-all">
<div class="text-left">
<div >
<h3>L'id de la voiture est :
{{Car.id}}
</h3>
<h3>
Model :
{{Car.getModel}}
</h3>
<h3>nom :
{{Car.name}}</h3>
<h3>Prix :{{Car.price}}
</h3>
{% if Car.image.name is defined %}
<p>
<h3>price :
<img width="100px" height="100px" src="{{ asset('pic/')~Car.image.name }}">
</h3>
</p>
{% else %}
<p>
<h3>price :</h3>
aucune image isérée</p>
{% endif %}
{% for keyword in Car.keywords %}
<p>
{{ keyword.name }}
{% if not loop.last %},
{% endif %}
</p>
{% endfor %}
{% if Car.cities | length > 0 %}
<p>
{% for city in Car.cities %}
<a class="waves-effect waves-light btn">
<i class="material-icons left">
{{ city.name }}</i>
</a>
{% if not loop.last %}{% endif %}
{% endfor %}
</p>
{% endif %}
<a href="{{path('library')}}">Accueil</a>
</div>
</div>
</div>
如果我理解正确的话,你想要的是左边的一些偏移
.offset-center {
margin-left: 50%;
transform: translateX(-50%);
min-width: 270px;
}
<div class="container" style="word-break: break-all">
<div class="text-left offset-center">
<div>
<h3>L'id de la voiture est : {{Car.id}}</h3>
<h3>Model : {{Car.getModel}}</h3>
<h3>nom : {{Car.name}}</h3>
<h3>Prix :{{Car.price}}</h3>
</div>
</div>
</div>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句