使按钮“搜索”可点击的HTML / CSS

时间:2013-03-03 20:18:11

标签: html css wordpress button

我的html / css代码有一个小问题!我想在我的wordpress主题中集成这个code,从而替换我的搜索框。

<form method="get" id="wrap-search-nav" class="header" action="<?php echo esc_url( home_url( '/' ) ); ?>" role="search">
<input type="texti" name="s" value="<?php echo esc_attr( get_search_query() ); ?>" id="search" placeholder="<?php echo esc_attr_x( 'Whater we looking', 'placeholder', 'twentythirteen' ); ?>" />
<input type="submit" name="submit" id="search_submit" value=""/>
</form>

当我点击放大镜的图像时,拳击正常打开但是当我写下我的研究并再次点击图像时,拳击将关闭。 我希望当我点击图片时,第二次我的研究开始

#wrap-search-nav {
   margin: 50px 100px;
   display: inline-block;
   position: relative;
   height: 60px;
   float: right;
   padding: 0;
   position: relative;
}

input[type="texti"] {
   height: 60px;
   font-size: 55px;
   display: inline-block;
   font-family: "Lato";
   font-weight: 100;
   border: none;
   outline: none;
   color: #555;
   padding: 3px;
   padding-right: 60px;
   width: 0px;
   position: absolute;
   top: 0;
   right: 0;
   background: none;
   z-index: 3;
   transition: width .4s cubic-bezier(0.000, 0.795, 0.000, 1.000);
   cursor: pointer;
}

input[type="texti"]:focus:hover {
   border-bottom: 1px solid #BBB;
}

input[type="texti"]:focus {
   width: 700px;
   z-index: 1;
   border-bottom: 1px solid #BBB;
   cursor: text;
}

input[type="submit"] {
   height: 67px;
   width: 63px;
   display: inline-block;
   color:red;
   float: right;
   background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADNQTFRFU1NT9fX1lJSUXl5e1dXVfn5+c3Nz6urqv7+/tLS0iYmJqampn5+fysrK39/faWlp////Vi4ZywAAABF0Uk5T/////////////////////wAlrZliAAABLklEQVR42rSWWRbDIAhFHeOUtN3/ags1zaA4cHrKZ8JFRHwoXkwTvwGP1Qo0bYObAPwiLmbNAHBWFBZlD9j0JxflDViIObNHG/Do8PRHTJk0TezAhv7qloK0JJEBh+F8+U/hopIELOWfiZUCDOZD1RADOQKA75oq4cvVkcT+OdHnqqpQCITWAjnWVgGQUWz12lJuGwGoaWgBKzRVBcCypgUkOAoWgBX/L0CmxN40u6xwcIJ1cOzWYDffp3axsQOyvdkXiH9FKRFwPRHYZUaXMgPLeiW7QhbDRciyLXJaKheCuLbiVoqx1DVRyH26yb0hsuoOFEPsoz+BVE0MRlZNjGZcRQyHYkmMp2hBTIzdkzCTc/pLqOnBrk7/yZdAOq/q5NPBH1f7x7fGP4C3AAMAQrhzX9zhcGsAAAAASUVORK5CYII=) center center no-repeat;
   text-indent: -10000px;
   border: none;
   position: absolute;
   top: 0;
   right: 0;
   z-index: 2;
   cursor: pointer;
   opacity: 0.4;
   cursor: pointer;
   transition: opacity .4s ease;
}

input[type="submit"]:hover {
   opacity: 0.8;
}

1 个答案:

答案 0 :(得分:0)

只需输入此项,因此在显示文本输入后会出现提交按钮。在这里工作。

input[type="submit"]:hover {
  opacity: 0.8;
  z-index: 4;
}