如何将文字带到左侧?

时间:2014-06-06 08:46:51

标签: html css

请参阅:CodePen

我想把这个文字留给左边。

HTML:

<div class="icon-thread">
  <ul>
    <li>
      <input type="radio" name="optionsRadios" class="optionsRadios2" value="option1"  checked="checked" title="Nenhum">
      <label class="radio" for="optionsRadios2"><i class="icon-ban-circle icon-stack-base text-error"></i></label>
    </li>
    <li>
      <input type="radio" name="optionsRadios" class="optionsRadios2" value="option2">
      <label class="radio" for="optionsRadios2"><i class="icon-fixed-width icon-moon"></i></label>
    </li>
    <li>
      <input type="radio" name="optionsRadios" class="optionsRadios2" value="option3">
      <label class="radio" for="optionsRadios2"><i class="icon-fixed-width icon-plane"></i></label>
    </li>
  </ul>
</div>

CSS:

@import url(//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css);

body{
  background:#314559
}

.icon-thread input[type='radio'] {
  opacity: 0;
  position:absolute;
  width:100%;
  height:100%
}

.icon-thread input[type='radio'] + label {
  margin:.6em;
  color: #B1B1B1;
  text-shadow: 1px 1px #fff
}

.icon-thread input[type='radio']:checked + label{
  color:#5F6F81
}

.icon-thread li{
  display: inline-block;
  margin:2% 0 1%
}

.icon-thread ul{
  border-bottom: 1px dashed #D1D8DD;
  background:#FAFAFA;
  text-align:right
}

2 个答案:

答案 0 :(得分:2)

代码:您可以添加其他Tags逗号分隔

如果您只想进入课程.icon-thread

p,h1,h2,h3.icon-thread{
  text-align:left;
}

如果您希望所有文字显示为左:

p,h1,h2,h3{
  text-align:left;
}

etvoilà

答案 1 :(得分:0)

.icon-thread ul
{
    border-bottom: 1px dashed #D1D8DD;
    background:#FAFAFA;
    text-align:left;
}

对于ul标签,只需将文本从右向左对齐