通用兼容纯CSS搜索框宽度自适应
版权声明:
本文为博主原创文章,转载请声明原文链接...谢谢。o_0。
更新时间:
2016-05-10 16:49:51
温馨提示:
学无止境,技术类文章有它的时效性,请留意文章更新时间,如发现内容有误请留言指出,防止别人"踩坑",我会及时更新文章
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <style type="text/css"> a{text-decoration: none;} body{background: #ededed;} .searchbox{display: block;background: #fff;margin: 0px auto; width: 500px;} .searchbox .input-wrap{display: block;margin-right: 94px;padding:0px 10px;} .searchbox input{border: 0px;outline: none; height: 30px;margin:5px 0px;width: 100%;} .searchbox input:focus{border: none;} .searchbox .s-btn{display: inline-block; background: #00ab36; color: #fff; float: right; font-size: 16px; text-align: center; height: 40px;line-height: 40px;padding:0px 15px;} </style> <div class="searchbox"> <a href="javascript:;" class="s-btn">搜索一下</a> <div class="input-wrap"> <input type="text" value="" /> </div> </div> </body> </html>