演示仿照日主题PRO美化而来。详细如图:
原版:
美化后:
美化教程:
在你的日主题根目录创建一个 searchform.php 文件,然后放入下面的代码。后台小工具拖入搜索小工具即可
<!--日主题美化 -- 搜索框小工具美化-- 向日葵全家桶 by:zmki.cn 2020年2月4日14:06:23-->
<style>
input[type="text"],input[type="password"],input[type="email"],input[type="search"],input[type="number"],input[type="tel"],textarea {
border: 0;
border-radius: 0;
font-family: Lato,sans-serif;
line-height: 36px;
margin-bottom: 10px;
padding: 0 12px;
transition: border-color cubic-bezier(0.77,0,0.175,1);
width: 100%;
border: 1px solid #f1f1f1;
}
input[type="text"]:focus,input[type="password"]:focus,input[type="email"]:focus,input[type="search"]:focus,input[type="number"]:focus,input[type="tel"]:focus,textarea:focus {
}
textarea {
height: 100%;
line-height: 1;
padding: 9px 12px;
resize: vertical;
border: 1px solid #d0d0d0;
border-radius: 4px;
max-height: 80px;
}
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-color: #fff;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAANCAYAAAC+ct6XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjBBRUQ1QTQ1QzkxMTFFMDlDNDdEQzgyNUE1RjI4MTEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjBBRUQ1QTU1QzkxMTFFMDlDNDdEQzgyNUE1RjI4MTEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGMEFFRDVBMjVDOTExMUUwOUM0N0RDODI1QTVGMjgxMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGMEFFRDVBMzVDOTExMUUwOUM0N0RDODI1QTVGMjgxMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pk5mU4QAAACUSURBVHjaYmRgYJD6////MwY6AyaGAQIspCieM2cOjKkIxCFA3A0TSElJoZ3FUCANxAeAWA6IOYG4iR5BjWwpCDQCcSnNgxoIVJCDFwnwA/FHWlp8EIpHSKoGgiggLkITewrEcbQO6mVAbAbE+VD+a3IsJTc7FQAxDxD7AbEzEF+jR1DDywtoCr9DbhwzDlRZDRBgACYqHJO9bkklAAAAAElFTkSuQmCC);
background-position: center right;
background-repeat: no-repeat;
border: 1px solid #e6e6e6;
border-radius: 0;
color: #1a1a1a;
font-family: inherit;
font-size: 14px;
height: 40px;
line-height: 40px;
outline: none;
padding: 0 14px;
width: 100%;
}
label {
display: inline-block;
margin-bottom: 5px;
vertical-align: middle;
}
input[type="checkbox"]+label {
margin-bottom: 0;
margin-left: 2px;
}
@-webkit-keyframes hue {
from {
-webkit-filter: hue-rotate(0deg);
}
to {
-webkit-filter: hue-rotate(-360deg);
}
}
form.inline {
position: relative;
}
form.inline .inline-field {
margin-bottom: 0;
padding-right: 20px;
text-overflow: ellipsis;
outline: none;
}
form.inline button[type="submit"] {
background-color: transparent;
border: 0;
color: #1a1a1a;
font-size: 16px;
height: 30px;
line-height: 30px;
margin-top: -15px;
padding: 0;
position: absolute;
right: 0;
text-align: center;
top: 50%;
width: 30px;
}
</style>
<form method="get" class="search-form inline" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<input type="search" class="search-field inline-field" placeholder="输入关键词,回车..." autocomplete="off" value="<?php echo esc_attr( get_search_query() ) ?>" name="s" required="required">
<button type="submit" class="search-submit"><i class="fa fa-search"></i></button>
</form>
感谢您的来访,获取更多精彩文章请收藏本站。
© 版权声明
THE END
请登录后查看评论内容