因为调整网站首页的需要,对标题所述问题进行了实验和研究,现保存和总结一下
1. 效果图:
2. 直接上代码!!呵呵
<form action="http://www.baidu.com/baidu" target="_blank" style=" background: #00FFFF; height: 30px; text-align: right; " >
<input type="text" name="word" size="60" placeholder="请输入搜索词">
<input type="submit" value="百度搜索-(一)">
</form>
<br>
<div id="container" style=" background: #8A2BE2; height: 60px; line-height: 60px; text-align: center; font-size: 16px; color: #000; line-height: 40px;">
<form action="http://www.baidu.com/baidu" target="_blank">
<div align="ritht">
<input name="tn" type="hidden" value="baidu">
<a >
<img src="img/search.png" align="bottom" border="0"></a>
<input type="text" name="word" size="40"/>
<input type="submit" value="百度搜索-(二)"/></div>
</form>
</div>
<br>
</br>
<form action="http://www.baidu.com/s" method="GET" target="_blank" style=" background: #7FFF00; height: 90px; line-height: 60px; text-align: left; font-size: 16px; color: #FFF0F5; line-height: 40px;">
<img src="http://www.baidu.com/img/baidu_jgylogo3.gif" alt="百度Logo" align="center"/>
<input type="text" name="wd" size="38" placeholder="请输入搜索内容" />
<input type="submit" value="百度搜索-(三)" />
<input type="hidden" name="ie" value="utf-8" />
<input type="hidden" name="tn" value="ace" />
</form>
<br>
<br>
<br>
<div id="百度搜索-四的开始">
<style id="placeholder的内容,“在这里输入要搜索的内容” 这几个字的颜色,设置为了 red">
input::-webkit-input-placeholder{
color:red;
}
input::-moz-placeholder{ /* Mozilla Firefox 19+ */
color:red;
}
input:-moz-placeholder{ /* Mozilla Firefox 4 to 18 */
color:red;
}
input:-ms-input-placeholder{ /* Internet Explorer 10-11 */
color:red;
}
</style>
<form action="http://www.baidu.com/s" method="GET" target="_blank" style=" background: #FFD700; height: 120px; text-align: right; margin-top: -50px;">
<img src="http://www.baidu.com/img/baidu_jgylogo3.gif" alt="百度Logo" align="right"/>
# 下面一句中的颜色,就是我们输入的 搜索内容文字的颜色,不是 “在这里输入要搜索的内容” 这几个字的颜色
<input type="text" name="wd" size="50" placeholder="在这里输入要搜索的内容" style="height:25px;font-size:26px; color: #0000FF;
outline:none;
border-top-style: groove;
border-right-style: groove;
border-bottom-style: groove;
border-left-style: groove;
border:1px solid #a1a1a1; " />
<input type="submit" value="百度搜索-(四)" style="font-size:26px; color: #FF0000; " />
<input type="hidden" name="ie" value="utf-8" />
<input type="hidden" name="tn" value="ace" />
</form>
</div id="百度搜索-四的结束!!">