使用materialize css对齐图标和两行文本

问题描述 投票:0回答:1

我需要将图标与两行文本对齐,我正在使用Materialise CSS。这是我的代码,但我无法解决。

有任何想法吗?

        <div class="col s12 m3 center">
                <i class="material-icons">access_time</i> 
                <span>Horario</span><br>
                <span>Helper text</span>
        </div>

附图可以更好地解释自己

enter image description here

css materialize
1个回答
2
投票

.d-flex {
  display: flex
}

.text {
  flex-direction: column;
  margin-left: 10px;
}

.fa-map-marker.marker {
  font-size: 35px;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="col s12 m3 center d-flex">
  <i class="fa fa-map-marker marker"></i>
  <div class="d-flex text">
    <span>Horario</span>
    <span>Helper text</span>
  </div>
</div>
© www.soinside.com 2019 - 2024. All rights reserved.