输入内部的glyphicons和内部警报

时间:2016-05-15 15:58:21

标签: html twitter-bootstrap css3 twitter-bootstrap-3 glyphicons

你好,我很难在输入标签中加入一个glyphicon,我已经尝试了几个代码来自这里和其他网站,但仍然无法得到它.. 这就是我所拥有的:

<div class="form-group">
    <label for="cedula">Cedula:</label>
    <div class="inner-addon left-addon">
        <i class="glyphicon glyphicon-user"></i>
        <input type="text" class="form-control" id="cedula" name="cedula" placeholder="Numero De Cedula" required="true"                                        autofocus="true" maxlength="9">
    </div>
</div>

这是我的css文件:

/* enable absolute positioning */
.inner-addon {
  position: relative;
}

/* style glyph */
.inner-addon .glyphicon {
  position: absolute;
  padding: 10px;
  pointer-events: none;
}

/* align glyph */
.left-addon .glyphicon  { left:  0px;}
.right-addon .glyphicon { right: 0px;}

/* add padding  */
.left-addon input  { padding-left:  30px; }
.right-addon input { padding-right: 30px; }

但我继续在输入之外得到这个奇怪的符号:

Input tag 按照Bootstrap文档,我正在尝试在警告框中实现glyphicon:

if( $errores !== ""){
    echo '<div class="alert alert-danger">'; 
    echo '<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>';
    echo $errores; 
    echo '</div>';
}

但又出现了奇怪的符号: Alert box glyphicon error

2 个答案:

答案 0 :(得分:0)

只使用此功能(无需额外的css):

           '4.FIDFLBIDA','1.809853','2015-04-16 12:04:21+0000',''
           'LB333','HK8','2015-05-23 16:20:00+0000',''
           '4.SMA-EI-REC','3.PAS-DYN-LTR','2015-04-10 04:00:00+0000',''

答案 1 :(得分:0)

使用这个:

<div class="input-group">
    <span class="input-group-addon" id="basic-addon1"><i class="glyphicon glyphicon-user" ></i></span>
    <input type="text" class="form-control" id="cedula" name="cedula" placeholder="Numero De Cedula" required="true"                                        autofocus="true" maxlength="9">
 </div>