2016-12-10 1 views
0

私は自分の入力をモバイルで入力するために100%の幅を得ようとしていますが、今は下の画像のようになります。私はjsFiddleとスニペットを投稿し、もし誰かが私がこれをいかに修正できるかについてのアイデアがあればそれはすばらしいでしょう。ありがとうございました! Jsfiddleは、私が変更しようとしているモバイルなので、特に問題が少し改善されていることを示しています。ブラウザでフォームを100%埋めてモバイル

JSFIDDLE:https://jsfiddle.net/wpz221qk/

enter image description here

input{ 
 

 
\t border: none; 
 
    border-bottom: 2px solid #959595; 
 
\t width:100%; 
 
\t margin:3px; 
 
\t color:#6C6A6A; 
 
\t padding-top:10px; 
 
\t padding-bottom: 10px; 
 
\t 
 
\t } 
 
\t 
 
\t .bottom{ 
 
\t \t border: none; 
 
    
 
\t 
 
\t margin:3px; 
 
\t 
 
\t color:#6C6A6A; 
 
\t padding-top:10px; 
 
\t padding-bottom: 10px; 
 
\t width: 300px; 
 
\t } 
 
\t .fa{ 
 
margin-right: 10px; 
 

 

 

 
\t } 
 
\t legend{ 
 
\t color:white; 
 
\t } 
 
\t 
 
.button { 
 
    display: inline-block; 
 
    padding: 15px 25px; 
 
    font-size: 14px; 
 
    cursor: pointer; 
 
    text-align: center; 
 
    text-decoration: none; 
 
    outline: none; 
 
    color: #fff; 
 
    background-color:#595959; 
 
    border: none; 
 
    border-radius: 15px; 
 
    box-shadow: 0 9px #999; 
 
    width: 150px; 
 

 
} 
 

 
.button:hover {background-color: #670809} 
 

 
.button:active { 
 
    background-color: #3e8e41; 
 
    box-shadow: 0 5px #666; 
 
    transform: translateY(4px); 
 
} 
 

 

 

 
form.contact label{ 
 
display: block; 
 
    
 
} 
 

 
span{ 
 
display:block; 
 
border: none; 
 
color:white; 
 
} 
 

 
.clearfix:after { 
 

 
    content:" "; 
 

 
    display:block; 
 

 
    clear:both; 
 

 
} 
 

 
section{ 
 
width: 95%; \t 
 

 
} 
 
fieldset{ 
 
width: 45%; \t 
 
float:left; 
 
border:none; 
 

 
} 
 

 
input.checks{ 
 
width: auto; \t 
 
} 
 

 
.left{ 
 
width: 45%; 
 
float:left; \t 
 
} 
 
.right{ 
 
width:45%; 
 
float: right; \t 
 
}
<div class="center clearfix" > 
 
<h1 id="fourth">Contact</h1> 
 

 
<form action="FormToEmail.php" method="POST" enctype="multipart/form-data" autocomplete="on" class="contact clearfix "> 
 
<section class="clearfix"> 
 
<fieldset><legend> 
 
<i class="fa fa-user" aria-hidden="true"></i>Personal Information 
 
<hr class="style2"> 
 
</legend> 
 
<label><span></span> <input name="first_name" type="text" value="" placeholder="First Name" required/> 
 
</label> 
 
<label><span> 
 
</span><input name="last_name" type="text" value="" placeholder="Last Name" required/> 
 
</label> 
 
<label><span> </span><input name="date_of_birth" type="date" value="" placeholder="Date of Birth" required/> 
 
</label> 
 

 
<label><span> 
 
</span><input type="number" name="quantity" min="1" max="6" placeholder="number of years until next degree"></label> 
 

 
<label ><span></span> <input name="level_of_education" type="hidden" value="" placeholder="level of education" required/></label> 
 
<select class="bottom" name="education_level"> 
 
<option value="High School">High School</option> 
 
<option value="Undergraduate">Undergradute</option> 
 
<option value="Graduate">Graduate</option> 
 
</select> 
 

 

 

 

 

 

 
</fieldset> 
 

 

 

 

 
<fieldset><legend><i class="fa fa-envelope-o" aria-hidden="true"></i> 
 
Contact Information <hr class="style2"></legend> 
 

 
<label><span> 
 
</span><input class="ghost-input" name="email" value="" type="email" placeholder="[email protected]" autocomplete="off" /></label> 
 

 
<label><span></span><input name="phonenumber" value="" type="tel" placeholder="763-858-9564" /></label> 
 

 
<label><span></span><input name="website" value="" type="url" placeholder="https://yourwebsite.com"/></label> 
 

 

 

 
</fieldset> 
 

 

 

 

 
</section> 
 

 

 

 

 
<section class="clearfix column" > 
 

 

 
<fieldset><legend><i class="fa fa-laptop" aria-hidden="true"></i> 
 
What are your Interests <hr class="style2"></legend> 
 

 

 
<section class="clearfix column left" > 
 
<label class="bottom span" ><span ><input name="webdesign" value="web_design" type="checkbox" class="checks"/>Web Design</span> 
 
</label> 
 

 
<label class="bottom"><span><input name="webdevelopment" value="web_development" type="checkbox" class="checks" />Web Development</span> 
 
</label> 
 

 
<label class="bottom"><span><input name="computerscience" value="computer_science" type="checkbox"class="checks" />Computer Science</span></label> 
 

 
</section> 
 
<section class="clearfix column left" > 
 

 
<label class="bottom"><span><input name="graphicdesign" value="graphic_design" type="checkbox" class="checks"/>Graphic Design</span> 
 
</label> 
 

 
<label class="bottom"><span><input name="userexperience" value="user_experience" type="checkbox" class="checks" />User Experience</span></label> 
 

 
<label class="bottom"><span><input class="checks" name="appdevelopment" value="app_development" type="checkbox" />App Development</span> 
 
</label> 
 
</section> 
 

 
</fieldset> 
 

 

 

 
<fieldset><legend><i class="fa fa-volume-control-phone" aria-hidden="true"> 
 

 
</i> 
 

 
Continuation <hr class="style2 toosmall"></legend> 
 

 
<section class="clearfix column left" > 
 

 
<legend class="smaller">You can contact me by:</legend> 
 
<br> 
 

 
<div class="squish"> 
 
<label class="bottom"><span><input class="checks" name="contact_me" type="radio" value="phone" checked/>Contact me by phone</span></label> 
 

 

 

 

 

 
<label class="bottom"><span><input class="checks" name="contact_me" type="radio" value="email" checked/>Contact me by email</span></label> 
 

 
<label class="bottom"><span><input class="checks" name="contact_me" type="radio" value="text"/>Contact me by text</span></label> 
 
<br> 
 
</div> 
 
</section> 
 

 

 
<section class="clearfix column left" > 
 
<legend class="smaller" >I'm interested in:</legend> 
 
<br> 
 

 
<label class="bottom"><span><input class="checks" name="interest" type="radio" value="text"/>Undergraduate</span></label> 
 
<label class="bottom"><span><input class="checks" name="interest" type="radio" value="text"/>Graduate</span></label> 
 
<label class="bottom"><span><input class="checks" name="interest" type="radio" value="text"/>Online</span></label> 
 
</section> 
 

 

 
</fieldset> 
 

 

 

 
</section> 
 

 

 

 

 
<input class="button" name="submit_to_programmer" type="submit" value="Subm

+2

です – j08691

答えて

1

があなたのを変更の幅は100%です。ここで

は、あなたのフィールドセットのCSSルールは、45%の幅を設定しているDEMO

input { 
 
    border: none; 
 
    border-bottom: 2px solid #959595; 
 
    width: 100%; 
 
    margin: 3px; 
 
    color: #6C6A6A; 
 
    padding-top: 10px; 
 
    padding-bottom: 10px; 
 
} 
 

 
.bottom { 
 
    border: none; 
 
    margin: 3px; 
 
    color: #6C6A6A; 
 
    padding-top: 10px; 
 
    padding-bottom: 10px; 
 
    width: 300px; 
 
} 
 

 
.fa { 
 
    margin-right: 10px; 
 
} 
 

 
legend { 
 
    width: 100%; 
 
    color: white; 
 
} 
 

 
.button { 
 
    display: inline-block; 
 
    padding: 15px 25px; 
 
    font-size: 14px; 
 
    cursor: pointer; 
 
    text-align: center; 
 
    text-decoration: none; 
 
    outline: none; 
 
    color: #fff; 
 
    background-color: #595959; 
 
    border: none; 
 
    border-radius: 15px; 
 
    box-shadow: 0 9px #999; 
 
    width: 150px; 
 
} 
 

 
.button:hover { 
 
    background-color: #670809 
 
} 
 

 
.button:active { 
 
    background-color: #3e8e41; 
 
    box-shadow: 0 5px #666; 
 
    transform: translateY(4px); 
 
} 
 

 
form.contact label { 
 
    display: block; 
 
} 
 

 
span { 
 
    display: block; 
 
    border: none; 
 
    color: white; 
 
} 
 

 
.clearfix:after { 
 
    content: " "; 
 
    display: block; 
 
    clear: both; 
 
} 
 

 
section { 
 
    width: 95%; 
 
} 
 

 
fieldset { 
 
    width: 100%; 
 
    float: left; 
 
    border: none; 
 
} 
 

 
input.checks { 
 
    width: auto; 
 
} 
 

 
.left { 
 
    width: 45%; 
 
    float: left; 
 
} 
 

 
.right { 
 
    width: 45%; 
 
    float: right; 
 
}
<div class="center clearfix"> 
 
    <h1 id="fourth">Contact</h1> 
 

 
    <form action="FormToEmail.php" method="POST" enctype="multipart/form-data" autocomplete="on" class="contact clearfix "> 
 
    <section class="clearfix"> 
 
     <fieldset> 
 
     <legend> 
 
      <i class="fa fa-user" aria-hidden="true"></i>Personal Information 
 
      <hr class="style2"> 
 
     </legend> 
 
     <label><span></span> 
 
      <input name="first_name" type="text" value="" placeholder="First Name" required/> 
 
     </label> 
 
     <label><span> 
 
</span> 
 
      <input name="last_name" type="text" value="" placeholder="Last Name" required/> 
 
     </label> 
 
     <label><span> </span> 
 
      <input name="date_of_birth" type="date" value="" placeholder="Date of Birth" required/> 
 
     </label> 
 

 
     <label><span> 
 
</span> 
 
      <input type="number" name="quantity" min="1" max="6" placeholder="number of years until next degree"> 
 
     </label> 
 

 
     <label><span></span> 
 
      <input name="level_of_education" type="hidden" value="" placeholder="level of education" required/> 
 
     </label> 
 
     <select class="bottom" name="education_level"> 
 
      <option value="High School">High School</option> 
 
      <option value="Undergraduate">Undergradute</option> 
 
      <option value="Graduate">Graduate</option> 
 
     </select> 
 

 

 

 

 

 

 
     </fieldset> 
 

 

 

 

 
     <fieldset> 
 
     <legend><i class="fa fa-envelope-o" aria-hidden="true"></i> Contact Information 
 
      <hr class="style2"> 
 
     </legend> 
 

 
     <label><span> 
 
</span> 
 
      <input class="ghost-input" name="email" value="" type="email" placeholder="[email protected]" autocomplete="off" /> 
 
     </label> 
 

 
     <label><span></span> 
 
      <input name="phonenumber" value="" type="tel" placeholder="763-858-9564" /> 
 
     </label> 
 

 
     <label><span></span> 
 
      <input name="website" value="" type="url" placeholder="https://yourwebsite.com" /> 
 
     </label> 
 

 

 

 
     </fieldset> 
 

 

 

 

 
    </section> 
 

 

 

 

 
    <section class="clearfix column"> 
 

 

 
     <fieldset> 
 
     <legend><i class="fa fa-laptop" aria-hidden="true"></i> What are your Interests 
 
      <hr class="style2"> 
 
     </legend> 
 

 

 
     <section class="clearfix column left"> 
 
      <label class="bottom span"><span><input name="webdesign" value="web_design" type="checkbox" class="checks"/>Web Design</span> 
 
      </label> 
 

 
      <label class="bottom"><span><input name="webdevelopment" value="web_development" type="checkbox" class="checks" />Web Development</span> 
 
      </label> 
 

 
      <label class="bottom"><span><input name="computerscience" value="computer_science" type="checkbox"class="checks" />Computer Science</span></label> 
 

 
     </section> 
 
     <section class="clearfix column left"> 
 

 
      <label class="bottom"><span><input name="graphicdesign" value="graphic_design" type="checkbox" class="checks"/>Graphic Design</span> 
 
      </label> 
 

 
      <label class="bottom"><span><input name="userexperience" value="user_experience" type="checkbox" class="checks" />User Experience</span></label> 
 

 
      <label class="bottom"><span><input class="checks" name="appdevelopment" value="app_development" type="checkbox" />App Development</span> 
 
      </label> 
 
     </section> 
 

 
     </fieldset> 
 

 

 

 
     <fieldset> 
 
     <legend><i class="fa fa-volume-control-phone" aria-hidden="true"> 
 

 
</i> Continuation 
 
      <hr class="style2 toosmall"> 
 
     </legend> 
 

 
     <section class="clearfix column left"> 
 

 
      <legend class="smaller">You can contact me by:</legend> 
 
      <br> 
 

 
      <div class="squish"> 
 
      <label class="bottom"><span><input class="checks" name="contact_me" type="radio" value="phone" checked/>Contact me by phone</span></label> 
 

 

 

 

 

 
      <label class="bottom"><span><input class="checks" name="contact_me" type="radio" value="email" checked/>Contact me by email</span></label> 
 

 
      <label class="bottom"><span><input class="checks" name="contact_me" type="radio" value="text"/>Contact me by text</span></label> 
 
      <br> 
 
      </div> 
 
     </section> 
 

 

 
     <section class="clearfix column left"> 
 
      <legend class="smaller">I'm interested in:</legend> 
 
      <br> 
 

 
      <label class="bottom"><span><input class="checks" name="interest" type="radio" value="text"/>Undergraduate</span></label> 
 
      <label class="bottom"><span><input class="checks" name="interest" type="radio" value="text"/>Graduate</span></label> 
 
      <label class="bottom"><span><input class="checks" name="interest" type="radio" value="text"/>Online</span></label> 
 
     </section> 
 

 

 
     </fieldset> 
 

 

 

 
    </section> 
 

 

 

 

 
    <input class="button" name="submit_to_programmer" type="submit" value="Submit" /> 
 
    <input type="hidden" value="Message from Car Website" name="subject"> 
 
    <input name="redirect" type="hidden" value="thanks.html"> 
 
    </form>

0

input{ 
 

 
\t border: none; 
 
    border-bottom: 2px solid #959595; 
 
\t width:80vw; /* changed from 100% to 80 vh 
 
\t margin:3px; 
 
\t color:#6C6A6A; 
 
\t padding-top:10px; 
 
\t padding-bottom: 10px; 
 
\t 
 
\t } 
 
\t 
 
\t .bottom{ 
 
\t \t border: none; 
 
    
 
\t 
 
\t margin:3px; 
 
\t 
 
\t color:#6C6A6A; 
 
\t padding-top:10px; 
 
\t padding-bottom: 10px; 
 
\t width: 300px; 
 
\t } 
 
\t .fa{ 
 
margin-right: 10px; 
 

 

 

 
\t } 
 
\t legend{ 
 
\t color:white; 
 
\t } 
 
\t 
 
.button { 
 
    display: inline-block; 
 
    padding: 15px 25px; 
 
    font-size: 14px; 
 
    cursor: pointer; 
 
    text-align: center; 
 
    text-decoration: none; 
 
    outline: none; 
 
    color: #fff; 
 
    background-color:#595959; 
 
    border: none; 
 
    border-radius: 15px; 
 
    box-shadow: 0 9px #999; 
 
    width: 150px; 
 

 
} 
 

 
.button:hover {background-color: #670809} 
 

 
.button:active { 
 
    background-color: #3e8e41; 
 
    box-shadow: 0 5px #666; 
 
    transform: translateY(4px); 
 
} 
 

 

 

 
form.contact label{ 
 
display: block; 
 
    
 
} 
 

 
span{ 
 
display:block; 
 
border: none; 
 
color:white; 
 
} 
 

 
.clearfix:after { 
 

 
    content:" "; 
 

 
    display:block; 
 

 
    clear:both; 
 

 
} 
 

 
section{ 
 
width: 95%; \t 
 

 
} 
 
fieldset{ 
 
width: 45%; \t 
 
float:left; 
 
border:none; 
 

 
} 
 

 
input.checks{ 
 
width: auto; \t 
 
} 
 

 
.left{ 
 
width: 45%; 
 
float:left; \t 
 
} 
 
.right{ 
 
width:45%; 
 
float: right; \t 
 
}
<div class="center clearfix" > 
 
<h1 id="fourth">Contact</h1> 
 

 
<form action="FormToEmail.php" method="POST" enctype="multipart/form-data" autocomplete="on" class="contact clearfix "> 
 
<section class="clearfix"> 
 
<fieldset><legend> 
 
<i class="fa fa-user" aria-hidden="true"></i>Personal Information 
 
<hr class="style2"> 
 
</legend> 
 
<label><span></span> <input name="first_name" type="text" value="" placeholder="First Name" required/> 
 
</label> 
 
<label><span> 
 
</span><input name="last_name" type="text" value="" placeholder="Last Name" required/> 
 
</label> 
 
<label><span> </span><input name="date_of_birth" type="date" value="" placeholder="Date of Birth" required/> 
 
</label> 
 

 
<label><span> 
 
</span><input type="number" name="quantity" min="1" max="6" placeholder="number of years until next degree"></label> 
 

 
<label ><span></span> <input name="level_of_education" type="hidden" value="" placeholder="level of education" required/></label> 
 
<select class="bottom" name="education_level"> 
 
<option value="High School">High School</option> 
 
<option value="Undergraduate">Undergradute</option> 
 
<option value="Graduate">Graduate</option> 
 
</select> 
 

 

 

 

 

 

 
</fieldset> 
 

 

 

 

 
<fieldset><legend><i class="fa fa-envelope-o" aria-hidden="true"></i> 
 
Contact Information <hr class="style2"></legend> 
 

 
<label><span> 
 
</span><input class="ghost-input" name="email" value="" type="email" placeholder="[email protected]" autocomplete="off" /></label> 
 

 
<label><span></span><input name="phonenumber" value="" type="tel" placeholder="763-858-9564" /></label> 
 

 
<label><span></span><input name="website" value="" type="url" placeholder="https://yourwebsite.com"/></label> 
 

 

 

 
</fieldset> 
 

 

 

 

 
</section> 
 

 

 

 

 
<section class="clearfix column" > 
 

 

 
<fieldset><legend><i class="fa fa-laptop" aria-hidden="true"></i> 
 
What are your Interests <hr class="style2"></legend> 
 

 

 
<section class="clearfix column left" > 
 
<label class="bottom span" ><span ><input name="webdesign" value="web_design" type="checkbox" class="checks"/>Web Design</span> 
 
</label> 
 

 
<label class="bottom"><span><input name="webdevelopment" value="web_development" type="checkbox" class="checks" />Web Development</span> 
 
</label> 
 

 
<label class="bottom"><span><input name="computerscience" value="computer_science" type="checkbox"class="checks" />Computer Science</span></label> 
 

 
</section> 
 
<section class="clearfix column left" > 
 

 
<label class="bottom"><span><input name="graphicdesign" value="graphic_design" type="checkbox" class="checks"/>Graphic Design</span> 
 
</label> 
 

 
<label class="bottom"><span><input name="userexperience" value="user_experience" type="checkbox" class="checks" />User Experience</span></label> 
 

 
<label class="bottom"><span><input class="checks" name="appdevelopment" value="app_development" type="checkbox" />App Development</span> 
 
</label> 
 
</section> 
 

 
</fieldset> 
 

 

 

 
<fieldset><legend><i class="fa fa-volume-control-phone" aria-hidden="true"> 
 

 
</i> 
 

 
Continuation <hr class="style2 toosmall"></legend> 
 

 
<section class="clearfix column left" > 
 

 
<legend class="smaller">You can contact me by:</legend> 
 
<br> 
 

 
<div class="squish"> 
 
<label class="bottom"><span><input class="checks" name="contact_me" type="radio" value="phone" checked/>Contact me by phone</span></label> 
 

 

 

 

 

 
<label class="bottom"><span><input class="checks" name="contact_me" type="radio" value="email" checked/>Contact me by email</span></label> 
 

 
<label class="bottom"><span><input class="checks" name="contact_me" type="radio" value="text"/>Contact me by text</span></label> 
 
<br> 
 
</div> 
 
</section> 
 

 

 
<section class="clearfix column left" > 
 
<legend class="smaller" >I'm interested in:</legend> 
 
<br> 
 

 
<label class="bottom"><span><input class="checks" name="interest" type="radio" value="text"/>Undergraduate</span></label> 
 
<label class="bottom"><span><input class="checks" name="interest" type="radio" value="text"/>Graduate</span></label> 
 
<label class="bottom"><span><input class="checks" name="interest" type="radio" value="text"/>Online</span></label> 
 
</section> 
 

 

 
</fieldset> 
 

 

 

 
</section> 
 

 

 

 

 
<input class="button" name="submit_to_programmer" type="submit" value="Subm

関連する問題