Bootstrap 如何将范围与文本和图标对齐

2skhul33  于 2022-12-07  发布在  Bootstrap
关注(0)|答案(1)|浏览(171)

I have four items I'd like to align horizontally but the last one doesn't.

My code is :

<span class="rate">8.5</span>
    <span><i class="material-icons md-18">star_rate</i></span>
    <span style="color:darkgrey" class="release-date">2000</span>
    <span style="color:darkgrey"><i class="material-icons md-18">date_range</i></span>

EDIT :

Even by adding display: inline-block it doesn't work. Here is my html :

.info {
           display: inline-block;
    }
<div class="info">
                  <span class="rate">8.5</span>
                  <span><i class="material-icons md-18">star_rate</i></span>
                  <span style="color:darkgrey" class="release-date">2000</span>
                  <span style="color:darkgrey"><i class="material-icons md-18">date_range</i></span>
    </div>

EDIT 2 : Full code with bootsrap columns

<div class="row">
            <div class="panel panel-default">
             <div class="panel-body">
            {% for i in "123456" %}
                <div class="col-md-2">
                            <a class="title movie" href="/series/{{ 1 }}/"><img class="img-responsive"</a>
                            <a class="title movie" href="/series/{{ 1 }}/"></a><br>
                            <div class="info">
                                <span id="1" class="rate">8.5</span>
                                <span id="2" ><i class="material-icons md-18">star_rate</i></span>
                                <span id="3" style="color:darkgrey" class="release-date">2000</span>
                                <span id="4" style="color:darkgrey"><i class="material-icons md-18">date_range</i></span>
                            </div>
                </div>
            {% endfor %}
            </div>
            </div>
        </div>
nxowjjhe

nxowjjhe1#

我看不出有什么变化。

<!--Import Google Icon Font-->
      <link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Compiled and minified CSS -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/css/materialize.min.css">
        
<span class="rate">8.5</span>
<span><i class="material-icons md-18">star_rate</i></span>
<span style="color:darkgrey" class="release-date">2000</span>
<span style="color:darkgrey"><i class="material-icons md-18">date_range</i></span>
 <!--Import jQuery before materialize.js-->
      <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
      <script type="text/javascript" src="js/materialize.min.js"></script>

相关问题