-3
私はCSSフォームをボタンの中に入れたいと思っていました。私は何とかCSSの中身を入れようとしたので私は失敗しました<input type="submit">
しかし、 htmlタグ<button>
代わりに...これは私のソリューションであり、あなたの検索ボタンに素敵な純粋なCSS検索アイコンを置きます。それは投稿フォームのボタンの中にCSSの形を入れてください
#search-icon {
font-size: 4em;
display: inline-block;
width: 0.4em;
height: 0.4em;
border: 0.1em solid #B10B14;
position: relative;
border-radius: 0.35em;
}
#search-icon::before {
content: "";
display: inline-block;
position: absolute;
right: -0.25em;
bottom: -0.1em;
border-width: 0;
background: #B10B14;
width: 0.35em;
height: 0.08em;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
}
<form role="search" method="get" id="searchform" action="<?php bloginfo('url'); ?>">
<input type="text" value="<?php echo get_search_query(); ?>" name="s" id="search-field" />
<button type="submit" id="search-icon-container">
<div id="search-icon"></div>
</button>
</form>
?ボタンはそれを正しく行うでしょうか? –
htmlは 'button'タグを持っています –
divをスタイルするのとまったく同じ方法で入力タグをスタイルすることができます。 – Shomz