效果:
淘宝搜索内容javascript实现
代码如下 | 复制代码 |
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>无标题文档</title> <style> body ,input,ul,h2 {margin:0;padding:0;} li {list-style:none;} div[id='search'] {margin:77px auto;width:400px;} input[type='submit'] { width:50px; height:34px;} input[type='text'] { border:1px solid #666; width:300px ;height:30px; } #search ul:nth-of-type(1){border:1px solid #666; width:300px; border-top:0; overflow:hidden; display:none;} #search ul li:nth-of-type(n) {height:30px; width:300px; line-height:30px; float:left;} #search ul li:hover{background:#06F;color:#fff;} #search li strong:nth-of-type(n){color:#000; font: 18px "微软雅黑" bold; float:left;} #search li span:nth-of-type(1) { float:right; color:#ccc;padding-right:10px;} </style> </head> <body> </body> window.onload=function() { |