css怎么设计文本框透明度
给input设置的css属性: background 和 color ,都用rgba 比如
background: rgba(255,255,255,0.5); color: rgba(255,255,255,1);
rgba中,a是透明度的意思,取值范围0-1,0是完全透明,1是完全不透明。
(推荐学习:CSS视频教程)
示例代码:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Document</title> <style> body{ background: #eee; } div{ height: 200px; width: 200px; padding: 10px; background: url(./css-5.jpg-600); background-size: 100% 100%; } input{ margin-top: 40px; background: rgba(255,255,255,0.5); color: rgba(255,255,255,1); } </style> </head> <body> <div> <input type="text"> </div> </body> </html>
效果:
更多CSS相关技术文章,请访问CSS3答疑栏目进行学习!
以上就是css怎么设计文本框透明度的详细内容,更多请关注0133技术站其它相关文章!