如何使用CSS设置<input>标签的背景小图标 简单
2014-02-25 16:40
1001 查看
<!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" /> <meta name="author" content="http://www.softwhy.com/" /> <title>蚂蚁部落</title> <style type="text/css"> ul { list-style:none; } li { height:30px; } input { width:140px; height:20px; line-height:20px; border:1px solid #0CF; padding-left:20px; } .myname { background:url(mytest/div+css/stock_people.png) center left no-repeat; } .mypw { background:url(mytest/div+css/security.png) center left no-repeat; } </style> </head> <body> <ul> <li><input type="text" class="myname" name="username" /></li> <li><input type="text" class="mypw" name="password" /></li> </ul> </body> </html>
相关文章推荐
- DivCSS布局实例:很实用的图文混排CSS列表
- HTML & CSS 常用的命名
- CSS3实例教程:详解calc()函数功能
- select input 样式
- CSS中文字体对照表
- css回到顶部
- css阴影效果实现方法分享
- 只用CSS做到完全居中
- css如何去掉a标签带来的虚框
- sharepoint 2010 隐藏左边菜单left menu样式脚本
- sharepoint 2010 隐藏左边菜单left menu样式脚本
- 你需要知道的三个 CSS 技巧
- 快速编写HTML,CSS代码的有力工具Emmet插件
- 垂直对齐样式 'vertical-align' 对齐兼容问题
- table隔行变色的css
- 纯CSS实现倒计时动画
- css样式兼容不同浏览器问题
- 第一个html+css页面
- CSS3 Media Queries
- QTableWidget详解(样式、右键菜单、表头塌陷、多选等)