左,中,右h1,h2内联

时间:2013-11-24 15:25:29

标签: html css

我无法对齐这三个要素。我想做这样的事情

enter image description here

但是我明白了 enter image description here

HTML

<div class="row">
    <div class="large-12 columns">
        <div id="controls" class="text-center">

            <h2 class="text-left">
                <i class="fa fa-chevron-left fa-small"></i>
            </h2>

            <h1 class="fittext text-center"> 
                Sunday
            </h1> 

            <h2 class="text-right">
                <i class="fa fa-chevron-right fa-small"></i>
            </h2>

        </div>
    </div>
</div>

CSS (Sass)

#controls
    display: inline
    h1, h2
      display: inline-block

1 个答案:

答案 0 :(得分:1)

#controls{
text-align:center
}
h1, h2{
display: inline-block}

Demo