- unselectable = "on"onselectstart = "return false;"
- : :-webkit - input - placeholder {
- /* WebKit browsers */
- color: #999;
- }: -moz - placeholder {
- /* Mozilla Firefox 4 to 18 */
- color: #999;
- }: :-moz - placeholder {
- /* Mozilla Firefox 19+ */
- color: #999;
- }: -ms - input - placeholder {
- /* Internet Explorer 10+ */
- color: #999;
- }
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8" />
- <style type="text/css">
- ::selection {
- background: #f60;
- color: #fff;
- }
- </style>
- </head>
- <body>
- <p>CSS选中状态修改 </p>
- </body>
- </html>
- <!DOCTYPE html>
- <html lang="zh">
- <head>
- <meta charset="UTF-8" />
- <style type="text/css">
- .input-file {
- position: relative;
- display: inline-block;
- background: #f60;
- border: 1px solid #f50;
- border-radius: 2px;
- overflow: hidden;
- color: #fff;
- font-size:20px;
- text-decoration: none;
- line-height: 20px;
- text-align:center;
- }
- .input-file input[type=file] {
- position: absolute;
- font-size: 100px;
- right: 0;
- top: 0;
- opacity:0;
- }
- .input-file:hover {
- background: #f50;
- border-color: #f50;
- color: #fff;
- text-decoration: none;
- }
- </style>
- </head>
- <body>
- <a href="javascript:;" class="input-file">选择文件
- <input type="file" name="" id="">
- </a>
- </body>
- </html>
来源: http://www.qdfuns.com/notes/47662/2bb32c3909e58c25cb78f857dd5ffd18.html