标签:
<html> <head> <meta charset="utf-8"> <title>百度一下,你就知道</title> <link rel="stylesheet" type="text/css" href="maiff.css"> </head> <body onkeydown="test(event.keyCode)"> <script type="text/javascript"> function test(va){ //var searchtext=document.getElementById("test").value; if(va==13){ window.open(‘https://www.baidu.com/s?ie=UTF-8&wd=‘+(document.getElementById("test").value)); } }; </script> <div class="link"> <a href="http://news.baidu.com/" target="_blank">新闻</a> <a href="http://v.baidu.com" target="_blank">视频</a> <a href="http://map.baidu.com" target="_blank">地图</a> <a href="http://tieba.baidu.com">贴吧</a> <a href="http://hao123.com">hao123</a> <hr> </div> <div class="img"> <img src="https://www.baidu.com/img/bd_logo1.png" > </div>
.link{ float:right; text-align:right; width:1366px; margin-bottom:10px; } .img{ text-align:center; margin-bottom:10px; } .img img{ width:270; height:129; } .form{ text-align:center; width:100%; } #test{ width:50%; height:35px } .form input{ height:35px; margin-bottom:20px; } .hidden{ width:100%; height:300px; } .copyright{ text-align:center; }
<div class="form"> <input type="text" id="test" /> <input type="button" value="百度一下" onclick="test(13)" /> </div> <div class="hidden"></div> <div class="copyright"> <p>copyright © 向王涛</p> </div> </body> </html>
自己写的简易百度,现在在熟悉css然后准备做网站,然后跟着学java然后在熟悉框架
标签:
原文地址:http://www.cnblogs.com/growlove/p/4907134.html