登陆界面输入框内加入小图标的样式怎么写?

zhlin508 2014-04-22 10:48:15

在登陆界面的输入框左边加一个小图标,如图,css样式应该怎么写?
...全文
27027 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_15780417 2015-10-10
  • 打赏
  • 举报
回复

<input type="text" class="inputAttr1" name="activityUserValue" for="reservation" placeholder="注册邮箱/用户名"/>
.inputAttr1{
background: url("../images/user_icon.png")no-repeat 315px ;
width: 350px;
height: 40px;
border-radius:5px;
border: 1px solid #999999;
box-shadow: 1px 1px 3px #cccccc;
padding-left: 10px;
margin-right: 10px;
}
这样也好简单的。。。
fdsaer 2015-05-28
  • 打赏
  • 举报
回复
原来是这样,学习了
zhlin508 2014-04-22
  • 打赏
  • 举报
回复
正是我要的效果,很感谢!
  • 打赏
  • 举报
回复
如下
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
.text{border:solid 2px #ccc;width:400px;height:40px;background:url(http://d.lanrentuku.com/down/png/1211/blueberry/user_friend.png) no-repeat 0 center;}
.text input{float:left;border:none;background:none;height:40px;line-height:30px;width:100%; text-indent:32px;}

</style>
</head>

<body>
<div class="text">
	<input type="text"/>
</div>
</body>
</html>

61,128

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧