Help us understand the problem. What is going on with this article?

【HTML】CSSによる検索フォームのデザイン

More than 1 year has passed since last update.

デフォルトのデザイン

form00.PNG

HTML
<form action="#">
    <input type="text">
    <input type="submit">
</form>

一体型

form01.PNG

HTML
<form id="form01" action="#">
    <input id="input01" type="text"><!--
    /input間で改行したい場合はコメントアウト必須/
    --><input id="submit01" type="submit" value="検索">
</form>
CSS
#form01{
    background-color: white;
    width:200px;
    height: 20px;
    border: 1px green solid;
}
#form01 input{
    vertical-align: top;
    margin: 0px;
    height: 100%;
    box-sizing: border-box;
    background-color: transparent;
}
#input01{
    width: 150px;
    border: none;
    border-right: 1px green solid;
}
#submit01{
    width: 50px;
    border: none;
}

一体型(画像ボタンによるsubmit)

form03.PNG

HTML
<form id="form02" action="#">
    <input id="input02" type="text" placeholder="検索"><!--
    /input間で改行したい場合はコメントアウト必須/
    --><input id="submit02" type="submit" value="">
</form>
CSS
#form02{
    background-color: white;
    width:200px;
    height: 20px;
    border: 1px green solid;
}
#form02 input{
    vertical-align: top;
    margin: 0px;
    height: 100%;
    box-sizing: border-box;
    background-color: transparent;
}
#form02{
    border-radius: 10px;
}
#input02{
    border: none;
    width: 170px;
    padding-left: 10px;
}
#submit02{
    width: 30px;
    border: none;
    background-image: url(画像へのパス);
    background-position: center;
    background-size: auto 90%;
    background-repeat: no-repeat;
}
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away