gpt4 book ai didi

javascript - 带有CSS的动画搜索栏

转载 作者:太空宇宙 更新时间:2023-11-04 13:44:08 25 4
gpt4 key购买 nike

我正在使用CSS搜索字段。您想帮我一些忙。如果访问演示页面,您将在搜索按钮前面看到一个菜单。搜索栏已打开。我想保留在底部的前菜单中。

这是JsFiddle中的DEMO PAGE

HTML代码:

<div class="b_t_menu3">
<div class="b_search">
<form method="get" class="search-form" action="http://www.google.com/search" target="top">
<input name="sitesearch" value="beben-koben.blogspot.com" type="hidden">
<input type="search" class="search-field" placeholder="Search &hellip;" value="" name="q" title="Search for..." />
<input type="submit" class="search-submit" value="Search" />
</form>
</div>
<div class="b_invitation"><a href="#">Menu</a></div>

</div>


和CSS CODE:

.b_t_menu3 {
float:left;
width:259px;
height:35px;
margin-left:2px;
border:1px solid #000;
}
.b_invitation {
float:left;
width:auto;
height:35px;
margin-left:12px;
positon:absolute;

}
.b_invitation a{
color:#545454;
font-family:'lucida grande',tahoma,verdana,arial,sans-serif;
text-decoration:none;
line-height:35px;
font-size:11px;

}
.b_search {
float:left;
width:35px;
height:35px;

}
.search-form .search-submit {
display: none;
}
input[type="search"] {
-webkit-appearance: textfield;
width: 0;
}
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
.search-form {

right: 10px;
top: 0px;
}
.search-field {
background-color: transparent;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABXUlEQVRIid2VMW4CMRBFTWsK5v+ZIlvBEZIWOAHcCcItkoI+6baHgosAKWgCV0jkFNgSIsLsLoqQMpK7r3l/Z+y/zt2jAAxJmaiiVMU2npKUCYBB48YiIqqcmzHkjirnIiK1mpPsm2F9bIK9GWcAxt77wntfABiZ8dmMn1GzJtmv1BxAxwyb6G4pIr3MV3ZVuUgQAJ2rgDQWVS6dc60KnloJosr5NfeD6OaQc35eItKLowwAhheFpEzj8mZVm6cy48yMgZTpRZEqyuhiVBcQFx9UUeYAWzOGdrv9UBfgvS8iYJsDfJgxeO+L5gDucoA0onFdAIBxvCCriyJSJrcvGS85F+ma7htc04MqvkTkKSu+5aGZ4a2KG0k5FKOim9GeRAVDBTPHimG3OQu70e+wO77e01MZAqBzLa5V8W2Gd+ecawSJoLMfDndmWJnhVUQeT7WNIXXqf0H+rPnd6gc2Q5KYa5pwPgAAAABJRU5ErkJggg==);
background-position: 5px center;
background-repeat: no-repeat;
background-size: 24px 24px;
border: none;
cursor: pointer;
width: 0;
height: 35px;
margin: 0px 0;
padding: 0 0 0 35px;

-webkit-transition: width 400ms ease, background 400ms ease;
transition: width 400ms ease, background 400ms ease;
}
.search-field:focus {
background-color: #fff;
border: 2px solid #ccc;
cursor: text;
outline: 0;
width: 230px;
}

最佳答案

我解决了我想制作动画搜索引擎的问题,但由于空间有限,我想使其成为流行音乐。流行搜索引擎前面有一个菜单。
当我单击搜索后,我想留下的菜单上的搜索引擎。我从来没有尝试过。解决了这个问题。如果有帮助,我想与您分享。

这正在我的教程演示中工作。 JSfiddle
HTML代码:

<div class="b_t_menu3">
<div class="b_search">
<form method="get" class="search-form" action="http://www.google.com/search" target="top">
<input name="sitesearch" value="Site içi arama" type="hidden">
<input type="search" class="search-field" placeholder="Search &hellip;" value="" name="q" title="Search for..." />
<input type="submit" class="search-submit" value="Search" />
</form>
</div>
<div class="b_invitation"><a href="#">Menu</a></div>

</div>


CSS代码:

.b_t_menu3 {
float:left;
width:259px;
height:35px;
margin-left:2px;
border:1px solid #000;
}
.b_invitation {
float:left;
width:auto;
height:35px;
margin-left:52px;
z-index:-3;
}
.b_invitation a{
color:#545454;
font-family:'lucida grande',tahoma,verdana,arial,sans-serif;
text-decoration:none;
line-height:35px;
font-size:11px;
}

.b_search {
float:left;
width:auto;
height:35px;
background-color:#fff;
position:absolute;
}
.search-form .search-submit {
display: none;
}
input[type="search"] {
-webkit-appearance: textfield;
width: 0;
}
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
.search-form {

right: 10px;
top: 0px;
}
.search-field {
background-color: transparent;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABXUlEQVRIid2VMW4CMRBFTWsK5v+ZIlvBEZIWOAHcCcItkoI+6baHgosAKWgCV0jkFNgSIsLsLoqQMpK7r3l/Z+y/zt2jAAxJmaiiVMU2npKUCYBB48YiIqqcmzHkjirnIiK1mpPsm2F9bIK9GWcAxt77wntfABiZ8dmMn1GzJtmv1BxAxwyb6G4pIr3MV3ZVuUgQAJ2rgDQWVS6dc60KnloJosr5NfeD6OaQc35eItKLowwAhheFpEzj8mZVm6cy48yMgZTpRZEqyuhiVBcQFx9UUeYAWzOGdrv9UBfgvS8iYJsDfJgxeO+L5gDucoA0onFdAIBxvCCriyJSJrcvGS85F+ma7htc04MqvkTkKSu+5aGZ4a2KG0k5FKOim9GeRAVDBTPHimG3OQu70e+wO77e01MZAqBzLa5V8W2Gd+ecawSJoLMfDndmWJnhVUQeT7WNIXXqf0H+rPnd6gc2Q5KYa5pwPgAAAABJRU5ErkJggg==);
background-position: 5px center;
background-repeat: no-repeat;
background-size: 24px 24px;
border: none;
cursor: pointer;
width: 0;
height: 35px;
margin: 0px 0;
padding: 0 0 0 35px;
-webkit-transition: width 400ms ease, background 400ms ease;
transition: width 400ms ease, background 400ms ease;

}
.search-field:focus {
background-color: #fff;
border: 2px solid #ccc;
cursor: text;
outline: 0;
width: 259px;
}

关于javascript - 带有CSS的动画搜索栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22610992/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com