网页添加百度搜索(已美化)
下面是CSS美化代码
<style type="text/css">
.login-button { /* 按钮美化 */
width: 270px; /* 宽度 */
height: 40px; /* 高度 */
border-width: 0px; /* 边框宽度 */
border-radius: 3px; /* 边框半径 */
background: #1E90FF; /* 背景颜色 */
cursor: pointer; /* 鼠标移入按钮范围时出现手势 */
outline: none; /* 不显示轮廓线 */
font-family: Microsoft YaHei; /* 设置字体 */
color: white; /* 字体颜色 */
font-size: 17px; /* 字体大小 */
}
.login-button:hover { /* 鼠标移入按钮范围时改变颜色 */
background: #5599FF;
}
.text-frame{width:400px; height:40px;}
</style>
下面是添加百度搜索代码
<body>
<div style="text-align:center">
<form action="https://www.baidu.com/s">
<input type="text" class="text-frame" name="wd">
<input type="submit" class="login-button" value="百度一下">
</form>
</div>
</body>
知道了输入框的name及数据提交到哪儿,就可以实现了,代码如下:
<form action="https://www.baidu.com/s">
<input type="text" name="wd">
<input type="submit" value="百度一下">
</form>
<style type="text/css">
.login-button { /* 按钮美化 */
width: 270px; /* 宽度 */
height: 40px; /* 高度 */
border-width: 0px; /* 边框宽度 */
border-radius: 3px; /* 边框半径 */
background: #1E90FF; /* 背景颜色 */
cursor: pointer; /* 鼠标移入按钮范围时出现手势 */
outline: none; /* 不显示轮廓线 */
font-family: Microsoft YaHei; /* 设置字体 */
color: white; /* 字体颜色 */
font-size: 17px; /* 字体大小 */
}
.login-button:hover { /* 鼠标移入按钮范围时改变颜色 */
background: #5599FF;
}
.text-frame{width:400px; height:40px;}
</style>
<input type="text" class="text-frame" name="wd">
<input type="submit" class="login-button" value="百度一下">
原文:https://www.cnblogs.com/zhuzhushop/p/15056619.html