我正在尝试使用css显示图像.但它无论如何都不显示.请帮我.我的代码是:
//styles.css
table tr td span.glyphicon-eye-open{
background: url("../images/private-eye.png") no-repeat;
}Run Code Online (Sandbox Code Playgroud)
//Register.php
<form method="post" id="form1">
<table align="center" width="45%" cellpadding="7px">
<tr>
<td><label>*</label><input type="text" name="email" placeholder=" Your Email" value="<?=$email?>"/></td>
</tr>
<tr>
<td><label>*</label> <input type="password" name="pass" id="passwordfield" placeholder=" Your Password" value="<?=$password?>"/>
<span class="glyphicon-eye-open"></span>
</td>
<tr>
<td><button type="submit" name="btn_Register">Register</button></td>
</tr>
</table>
</form>Run Code Online (Sandbox Code Playgroud)
我还包含'link rel ="stylesheet"href ="../ css/styles.css"type ="text/css"/'in head with tags
那是因为你的跨度根本没有高度.每个跨度都没有高度,直到您在其中插入一些文本或通过CSS编辑其高度.例如,我在这里放了一些文字,如下:
span.glyphicon-eye-open {
background: url("http://beerhold.it/320/200") no-repeat;
color: #fff;
}Run Code Online (Sandbox Code Playgroud)
//Register.php
<form method="post" id="form1">
<table align="center" width="45%" cellpadding="7px">
<tr>
<td><label>*</label><input type="text" name="email" placeholder=" Your Email" value="<?=$email?>"/></td>
</tr>
<tr>
<td><label>*</label> <input type="password" name="pass" id="passwordfield" placeholder=" Your Password" value="<?=$password?>"/>
<span class="glyphicon-eye-open">@@@</span>
</td>
<tr>
<td><button type="submit" name="btn_Register">Register</button></td>
</tr>
</table>
</form>Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
116 次 |
| 最近记录: |