我在做一个website。当你点击我的搜索框时,文本会消失,就像它应该的那样,但是一旦你点击文本就不会回来,我希望它能够。这里是我的代码段Css/Html文本框消失文本不起作用
<div class='search'>
<form method="get" id='search' action="http://www.google.com/search">
<input type="hidden" name="q" size="31" maxlength="255" value="Site Name:" />
<input type="text" name="q" size="31" maxlength="255" style="height: 24px;" value="Search..." onFocus="this.value=''" />
</div>
我有很多的CSS的背后,使文本框放大和改变颜色。这里是代码,以防万一它是相关的。
#search input[type="text"] {
background: url(imgs/search-white.png) no-repeat 10px 6px #444;
border: 0 none;
font: bold 12px Arial,Helvetica,Sans-serif;
color: #d7d7d7;
width:150px;
padding: 6px 15px 6px 35px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
text-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2) inset;
-moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2) inset;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2) inset;
-webkit-transition: all 0.7s ease 0s;
-moz-transition: all 0.7s ease 0s;
-o-transition: all 0.7s ease 0s;
transition: all 0.7s ease 0s;
outline: none;
}
#search input[type="text"]:focus {
background: url(imgs/search-dark.png) no-repeat 10px 6px #fcfcfc;
color: #6a6f75;
width: 175px;
-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.9) inset;
-moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.9) inset;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.9) inset;
text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
outline: none;
}
div.search
{
position:fixed;
top:8px;
right:5px;
}
当盒子被点击框下放大和Search...
文本消失喜欢它应该。但是,一旦你点击文本不会返回,我希望它。我怎么做? *侧面说明 对不起,如果网站看起来坏的IM 13
顺便说一下,Java和Javascript是两种*非常*不同的语言。你想要Javascript,网页语言。 Java被用来制作* real *程序 - 这种类型是通过双击桌面上的图标来运行的。 (网络程序员没有冒犯) – MathSquared 2013-02-10 01:36:17
@ MathSquared11235谢谢你,我并不知道 – 2013-02-10 01:40:57
@ MathSquared11235 http://stackoverflow.com/questions/14793773/auto-google-search-results-on-my-website – 2013-02-10 01:48:26