0

私はMaterializeCSSを使用してきましたが、集中化するのに問題があります。次のスニペットがあり、多くのことを試しましたが、常に左揃えになるため、集中化する方法がわかりません

どうすればいいのですか?

@import 'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.0/css/materialize.min.css';
      <div class="row">
        <div class="col s12 m5 profile-inner center-block">
          <img class="circle responsive-img perfil-icon" src="http://ddragon.leagueoflegends.com/cdn/6.24.1/img/profileicon/600.png">
          <br><span class="center-align"style="font-size: 2.5rem">TyG Yeux</span><br>
          
          <span style="font-size: 1.5rem">Level 50</span>
        </div>

4

1 に答える 1

1

center-alignの代わりに使用しcenter-blockます。center-block画像自体のセンタリングに使用するのに適しています。しかし、現在、親コンテナから中央に配置したいため、center-align を使用してすべての子を中央に揃える必要があります。

@import 'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.0/css/materialize.min.css';
<div class="row">
        <div class="col s12 m5 profile-inner center-align">
          <img class="circle responsive-img perfil-icon" src="http://ddragon.leagueoflegends.com/cdn/6.24.1/img/profileicon/600.png">
          <br><span class="center-align"style="font-size: 2.5rem">TyG Yeux</span><br>
          
          <span style="font-size: 1.5rem">Level 50</span>
        </div>

于 2018-02-26T03:21:01.687 に答える