我正在尝试使用css显示图像 . 但它无论如何都不显示 . 请帮我 . 我的代码是:
//styles.css
table tr td span.glyphicon-eye-open{
background: url("../images/private-eye.png") no-repeat;
}
//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>
我还包含'link rel =“stylesheet”href =“../ css / styles.css”type =“text / css”/'in head with tags
4 回答
那是因为你的 Span 根本没有高度 . 在您插入一些文本或通过CSS编辑其高度之前,每个 Span 都没有高度 . 例如,我在这里放了一些文字,如下:
改变这一行
至:
DEMO
现在使用以下css代码可以正常工作:
}
试试这个
确保包含css