在Materialise CSS中居中复选框/单选按钮

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

我无法使用Materialise CSS获取中心对齐的复选框。

<div class="center-align">

    <h5>Select Value </h5>

    <form action="#" >

            <p class="center-align">
              <input class="filled-in" name="group1" type="checkbox" id="1">
              <label for="1" class="teal-text text-lighten-2" >First</label>
            </p>
            <p class="center-align">
              <input  class="filled-in"name="group1" type="checkbox" id="2">
              <label for="2" class="teal-text text-lighten-2">Second</label><span></span>
            </p>
    </form>

enter image description here

这导致复选框在中心对齐,但彼此偏移。如果标签完全相同,则它们匹配。

我已经尝试将中心对齐类添加到<div><form><input><p>但是没有任何工作正如我所期望的那样。

html css material-design materialize
1个回答
1
投票

通过添加此css能够达到预期的结果

<style>
      label{  
          left: 50%;
        }   
</style>
© www.soinside.com 2019 - 2024. All rights reserved.