I am trying to email this survey and its results as a string to an email address when the "send Survey" button is clicked. I cannot figure out how to make this action occur. Does anyone have any ideas how to accomplish this? I have tried using the form tag with the action set to mailto:recipient#yahoo.com and the method as get. Is there anything I am missing here? I have read several pages on emailing surveys on HTML button actions. Thanks. I have the following code:
//preset all form values
document.ColorSurvey.Visistor.value = "John Doe";
document.ColorSurvey.State.Selectedindex = 5;
document.ColorSurvey.Password.value = "shhhhh';
document.ColorSurvey.Gender[1].checked = true;
.form {
margin: 0 auto;
width: 210px;
}
.form label {
display: inline-block;
text-align: right;
float: left;
}
.form input {
display: inline-block;
text-align: left;
float: right;
}
.center {
margin: auto;
width: 50%;
border: 3px solid green;
padding: 10px;
}
label.orange {
color: orange;
}
label.violet {
color: violet;
}
label.grey {
color: grey;
}
label.yellow {
color: yellow;
}
label.red {
color: red;
}
label.green {
color: green;
}
label.pink {
color: pink;
}
label.blue {
color: blue;
}
<title>
Color Survey
</title>
<h1>Color Survey</h1>
<form action=”mailto:contact#yourdomain.com” method=”get” enctype=”multipart/form-data” name=”EmailTestForm”>
<div align="center">
<label>Name:</label>
<input type="text" name="name:">
<br>
<label>Email:</label>
<input type="text" name="email:">
<br>
<label>Phone:</label>
<input type="text" name="phone:">
<label>EXT:</label>
<input type="text" name="EXT:" style="width: 45px;">
<br>
<label>State:<select id="countrySelect" name="countrySelect">
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="DC">District Of Columbia</option>
<option value="FL">Florida</option>
<option value="GA">Georgia</option>
<option value="HI">Hawaii</option>
<option value="ID">Idaho</option>
<option value="IL">Illinois</option>
<option value="IN">Indiana</option>
<option value="IA">Iowa</option>
<option value="KS">Kansas</option>
<option value="KY">Kentucky</option>
<option value="LA">Louisiana</option>
<option value="ME">Maine</option>
<option value="MD">Maryland</option>
<option value="MA">Massachusetts</option>
<option value="MI">Michigan</option>
<option value="MN">Minnesota</option>
<option value="MS">Mississippi</option>
<option value="MO">Missouri</option>
<option value="MT">Montana</option>
<option value="NE">Nebraska</option>
<option value="NV">Nevada</option>
<option value="NH">New Hampshire</option>
<option value="NJ">New Jersey</option>
<option value="NM">New Mexico</option>
<option value="NY">New York</option>
<option value="NC">North Carolina</option>
<option value="ND">North Dakota</option>
<option value="OH">Ohio</option>
<option value="OK">Oklahoma</option>
<option value="OR">Oregon</option>
<option value="PA">Pennsylvania</option>
<option value="RI">Rhode Island</option>
<option value="SC">South Carolina</option>
<option value="SD">South Dakota</option>
<option value="TN">Tennessee</option>
<option value="TX">Texas</option>
<option value="UT">Utah</option>
<option value="VT">Vermont</option>
<option value="VA">Virginia</option>
<option value="WA">Washington</option>
<option value="WV">West Virginia</option>
<option value="WI">Wisconsin</option>
<option value="WY">Wyoming</option>
</select>
<br>
<label>Password:</label>
<input type="text" name="Password:">
<label>Confirm:</label>
<input type="text" name="Confirm:">
</div>
<div align="center">
<label><input type="checkbox" name="favcolors[]" value="cycling" /> black</label>
<label class='orange'><input type="checkbox" name="favcolors[]" value="orange" /> orange</label>
<label class='violet'><input type="checkbox" name="favcolors[]" value="violet" /> violet</label>
<br>
<label class='grey'><input type="checkbox" name="favcolors[]" value="Grey" /> Grey</label>
<label class='yellow'><input type="checkbox" name="favcolors[]" value="Yellow" /> Yellow</label>
<label><input type="checkbox" name="favcolors[]" value="White" /> White</label>
<br>
<label class='red'><input type="checkbox" name="favcolors[]" value="red" /> red</label>
<label class='green'><input type="checkbox" name="favcolors[]" value="green" /> green</label>
<label><input type="checkbox" name="favcolors[]" value="other" /> other</label>
<br>
<label class='pink'><input type="checkbox" name="favcolors[]" value="pink" /> pink</label>
<label class='blue'><input type="checkbox" name="favcolors[]" value="blue" /> blue</label>
</div>
<div align='center'>
<label>Comments:</label>
<input type="text" name="Comments:" style="width: 300px; height: 40px;">
<br>
<br>
<label>Code:</label>
<input type="text" name="Comments:" style="width: 80px;">
<label>For internal use only</label>
<br>
<button>Send Survey</button>
<button>Clear Form</button>
</div>
</form>
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I am attempting to use CSS grid (orderForm.css below) however the css styling is not responding to the html that i have written. I have found a lot of times I am not calling the element correctly due to nesting of divs. I was hoping you all could look at my code and tell me what is going on. Some pages it works in visual studios and some pages do not work.
/* Skeleton of pages below */
.grid-container {
display: grid;
grid-template-columns: repeat(12, 1fr);
grid-template-rows: repeat(4, 1fr);
}
nav#original.navigation,
h1 {
grid-column: 4 / 10;
grid-row: 1 / 2;
text-align: center;
}
/* Fix the images, not correctly displaying */
div.blackLogo {
grid-column: 1 / 4;
grid-row: 1 / 2;
image-resolution: from-image 300dpi;
}
div.pinkLogo {
grid-column: 10 / 13;
grid-row: 1 / 2;
}
ul li {
display: inline;
list-style: none;
}
/* Footer not responding to grid dimensons */
footer {
grid-column: 1 / 13;
grid-row: 4 / 5;
text-align: center;
}
h1 {
padding: 10px;
}
/* div#all.container {
grid-column: 1/13 ;
grid-row: 2/3;
} */
/* div#name.container, div#billing-address.container,div#mailing-address.container {
display: inline;
grid-column: 1 / 7;
grid-row: 2 / 4;
}*/
body>div.grid-container>div#partOne.container {
grid-column: 1 / 7;
grid-row: 2 / 4;
}
/* columns not running span of grid-column dimensions */
div#partTwo.container {
grid-column: 7 / 13;
grid-row: 2 / 4;
}
/* div#product-choice.container >h2#product-Choice.heading {
text-align: center;
} */
/* div#partTwo.container > div#product-choice.container > h2#product-choice.heading {
grid-column: 7 / 13;
grid-row: 2 / 4;
} */
<div class="grid-container">
<nav class="navigation" id="original">
<ul>
<li>Home</li>
<li>About Us</li>
<li>Order</li>
<li>Order form</li>
<li>Gallery</li>
</ul>
</nav>
<h1 class="name" id="order-form">Order Form</h1>
<div class="blackLogo">
<img src="/images/hoodHealerBlack.jpg" alt="Black Hood Healer Logo" width="200" height="80" class="logo" id="Black" />
</div>
<div class="pinkLogo">
<img src="/images/hoodHealerPink.jpg" alt="Pink Hood Healer Logo" width="200" height="80" class="logo" id="Pink" />
</div>
<div class="container" id="partOne">
<div class="container" id="name">
<h2>Name</h2>
<label for="Fname">First Name:</label>
<input type="text" id="Fname" name="first-name" />
<label for="MInitial">Middle Initial:</label>
<input type="text" id="MInitial" name="middle-initial" />
<label for="Lname">Last Name:</label>
<input type="text" id="Lname" name="last-name" />
</div>
<div class="container" id="billing-address">
<h2 class="heading" id="billingAddress">Billing Address</h2>
<label for="Street-address">Street Address:</label>
<input type="text" id="Street-address" name="StreetAdress" />
<label for="apartment-PO">Apt # or PO Box:</label>
<input type="number" id="apartment-PO" name="apartmentPOBox" />
<!--City, state ; zip code- number; apt number or po box input - number-->
<br />
<label for="city">City:</label>
<input type="text" id="city" name="city" />
<form>
<fieldset>
<label for="state">State</label>
<select id="state" name="state">
<option value="---">---</option>
<option value="Alabama">Alabama</option>
<option value="Alaska">Alaska</option>
<option value="Arizona">Arizona</option>
<option value="Arkansas">Arkansas</option>
<option value="California">California</option>
<option value="Colorado">Colorado</option>
<option value="Connecticut">Connecticut</option>
<option value="Delaware">Delaware</option>
<option value="District of Columbia">
District of Columbia
</option>
<option value="Florida">Florida</option>
<option value="Georgia">Georgia</option>
<option value="Guam">Guam</option>
<option value="Hawaii">Hawaii</option>
<option value="Idaho">Idaho</option>
<option value="Illinois">Illinois</option>
<option value="Indiana">Indiana</option>
<option value="Iowa">Iowa</option>
<option value="Kansas">Kansas</option>
<option value="Kentucky">Kentucky</option>
<option value="Louisiana">Louisiana</option>
<option value="Maine">Maine</option>
<option value="Maryland">Maryland</option>
<option value="Massachusetts">Massachusetts</option>
<option value="Michigan">Michigan</option>
<option value="Minnesota">Minnesota</option>
<option value="Mississippi">Mississippi</option>
<option value="Missouri">Missouri</option>
<option value="Montana">Montana</option>
<option value="Nebraska">Nebraska</option>
<option value="Nevada">Nevada</option>
<option value="New Hampshire">New Hampshire</option>
<option value="New Jersey">New Jersey</option>
<option value="New Mexico">New Mexico</option>
<option value="New York">New York</option>
<option value="North Carolina">North Carolina</option>
<option value="North Dakota">North Dakota</option>
<option value="Northern Marianas Islands">
Northern Marianas Islands
</option>
<option value="Ohio">Ohio</option>
<option value="Oklahoma">Oklahoma</option>
<option value="Oregon">Oregon</option>
<option value="Pennsylvania">Pennsylvania</option>
<option value="Puerto Rico">Puerto Rico</option>
<option value="Rhode Island">Rhode Island</option>
<option value="South Carolina">South Carolina</option>
<option value="South Dakota">South Dakota</option>
<option value="Tennessee">Tennessee</option>
<option value="Texas">Texas</option>
<option value="Utah">Utah</option>
<option value="Vermont">Vermont</option>
<option value="Virginia">Virginia</option>
<option value="Virgin Islands">Virgin Islands</option>
<option value="Washington">Washington</option>
<option value="West Virginia">West Virginia</option>
<option value="Wisconsin">Wisconsin</option>
<option value="Wyoming">Wyoming</option>
</select>
</fieldset>
</form>
<label for="zip-code">Zip Code:</label>
<input type="number" id="zip-code" name="zipcode" />
<input type="checkbox" id="mailing-address" name="mailingaddress" value="Mailing address" />
<label for="mailing-address">
Mailing address is the same as billing address.</label
><br />
<div class="container" id="mailing_address">
<h2 class="heading" id="mailingAddress">Mailing Address</h2>
<label for="Street_address">Street Address:</label>
<input type="text" id="Street_address" name="StreetAdress" />
<label for="apartment_PO">Apartment number or PO Box:</label>
<input type="number" id="apartment_PO" name="apartmentPOBox" />
<!--City, state ; zip code- number; apt number or po box input - number-->
<label for="zip_code">Zip Code:</label>
<input type="number" id="zip_code" name="zipcode" />
<label for="City">City:</label>
<input type="text" id="City" name="city" />
<form>
<fieldset>
<label for="State">State</label>
<select id="State" name="state">
<option value="---">---</option>
<option value="Alabama">Alabama</option>
<option value="Alaska">Alaska</option>
<option value="Arizona">Arizona</option>
<option value="Arkansas">Arkansas</option>
<option value="California">California</option>
<option value="Colorado">Colorado</option>
<option value="Connecticut">Connecticut</option>
<option value="Delaware">Delaware</option>
<option value="District of Columbia">
District of Columbia
</option>
<option value="Florida">Florida</option>
<option value="Georgia">Georgia</option>
<option value="Guam">Guam</option>
<option value="Hawaii">Hawaii</option>
<option value="Idaho">Idaho</option>
<option value="Illinois">Illinois</option>
<option value="Indiana">Indiana</option>
<option value="Iowa">Iowa</option>
<option value="Kansas">Kansas</option>
<option value="Kentucky">Kentucky</option>
<option value="Louisiana">Louisiana</option>
<option value="Maine">Maine</option>
<option value="Maryland">Maryland</option>
<option value="Massachusetts">Massachusetts</option>
<option value="Michigan">Michigan</option>
<option value="Minnesota">Minnesota</option>
<option value="Mississippi">Mississippi</option>
<option value="Missouri">Missouri</option>
<option value="Montana">Montana</option>
<option value="Nebraska">Nebraska</option>
<option value="Nevada">Nevada</option>
<option value="New Hampshire">New Hampshire</option>
<option value="New Jersey">New Jersey</option>
<option value="New Mexico">New Mexico</option>
<option value="New York">New York</option>
<option value="North Carolina">North Carolina</option>
<option value="North Dakota">North Dakota</option>
<option value="Northern Marianas Islands">
Northern Marianas Islands
</option>
<option value="Ohio">Ohio</option>
<option value="Oklahoma">Oklahoma</option>
<option value="Oregon">Oregon</option>
<option value="Pennsylvania">Pennsylvania</option>
<option value="Puerto Rico">Puerto Rico</option>
<option value="Rhode Island">Rhode Island</option>
<option value="South Carolina">South Carolina</option>
<option value="South Dakota">South Dakota</option>
<option value="Tennessee">Tennessee</option>
<option value="Texas">Texas</option>
<option value="Utah">Utah</option>
<option value="Vermont">Vermont</option>
<option value="Virginia">Virginia</option>
<option value="Virgin Islands">Virgin Islands</option>
<option value="Washington">Washington</option>
<option value="West Virginia">West Virginia</option>
<option value="Wisconsin">Wisconsin</option>
<option value="Wyoming">Wyoming</option>
</select>
</fieldset>
</form>
</div>
</div>
</div>
<div class="contaitner" id="partTwo">
<div class="container" id="product-choice">
<h2 class="heading" id="product-Choice">Choose your product:</h2>
<form>
<input type="radio" id="Hat" name="Product" value="HAT" />
<label for="Hat">Hat</label><br />
<input type="radio" id="Shirt" name="Product" value="SHIRT" />
<label for="Shirt">Shirt</label><br />
<input type="radio" id="Hoodie" name="Product" value="HOODIE" />
<label for="Hoodie">Hoodie</label><br />
<input type="radio" id="Pants" name="Product" value="PANTS" />
<label for="Pants">Pants</label><br />
</form>
</div>
<div class="container" id="size-choice">
<h2 class="heading" id="size-Choice">Choose your size:</h2>
<form>
<input type="radio" id="Small" name="Size" value="SMALL" />
<label for="Small">Small</label><br />
<input type="radio" id="Medium" name="Size" value="MEDIUM" />
<label for="Medium">Medium</label><br />
<input type="radio" id="Large" name="Size" value="LARGE" />
<label for="Large">Large</label><br />
<input type="radio" id="X-Large" name="Size" value="X-LARGE" />
<label for="X-Large">X-Large</label><br />
<input type="radio" id="XX-Large" name="Size" value="XX-LARGE" />
<label for="XX-Large">XX-Large</label><br />
<input type="radio" id="XXX-Large" name="Size" value="XXX-LARGE" />
<label for="XXX-Large">XXX-Large</label><br />
<input type="radio" id="XXXX-Large" name="Size" value="XXXX-LARGE" />
<label for="XXXX-Large">XXXX-Large</label><br />
<input type="radio" id="XXXXX-Large" name="Size" value="XXXXX-LARGE" />
<label for="XXXXX-Large">X-Large</label><br />
</form>
</div>
<div class="container" id="logo-color">
<h2 class="heading" id="logo-Color">Choose your style of logo:</h2>
<form>
<input type="radio" id="pink" name="logoColor" value="PINK" />
<label for="pink">Pink</label><br />
<input type="radio" id="black" name="logoColor" value="BLACK" />
<label for="black">Black</label><br />
<!-- <input type="radio" id="Custom" name="logoColor" value="CUSTOM">
<label for="Custom">Custom</label> -->
</form>
<input type="submit" value="Submit" />
</div>
</div>
<footer>
<p>copyright Kajah's Krafts</p>
Contact Us
</footer>
</div>
After going back and double checking my CSS file and the link to the CSS file i found my error. Line 235 container is spelled wrong
Most of the time, when you aren't seeing your stylings being applied, it is a problem with loading the stylesheets. Can you ensure that you are including the link tag in every page's head?
<head>
<!-- omit -->
<link rel="stylesheet" href="/CSS/orderForm.css">
</head>
Most likely the link to your style sheet is pointing to the wrong location. /CSS/orderForm.css try removing the / like this "CSS/orderForm.css"
I have full div in which there are two divs: one div for images and other div for a form. The two divs should be side by side to each other. The issue is that the form div is going below the image, not side by side with the image. Here is the error image:
I have tried but have not got the needed results.
Both the div should be responsive for all devices
.container {
width: 960px;
margin: 0px auto;
}
#left-column {
height: 500px;
width: 700px;
float: left;
background-color: blue;
}
#right-column {
height: 500px;
width: 260px;
float: left;
background-color: orange;
}
#media screen and (max-width:959px) {
.container {
width: 100%;
}
#left-column {
width: 70%;
}
#right-column {
width: 30%;
}
img {
width: 100%;
}
}
#media screen and (max-width:640px) {
#left-column {
width: 100%;
}
#right-column {
width: 100%;
}
}
#media screen and (max-width:320px) {
.container {
width: 320px;
}
}
<div class="container">
<img src="images/banner.jpg" />
<section id="left-column">
<img src="images/future.jpg" style="height:500px; width:700px;">
</section>
<aside id="right-column">
<div class="col-md-4">
<div class="container">
<div class="form-row">
<div class="form-group">
<label for="name"></label>
<input type="text" class="form-control" id="fullname" name="fullname" value="" placeholder="ENTER NAME" required>
</div>
<div class="form-group">
<label for="email"></label>
<input type="email" class="form-control" id="email" name="email" value="" placeholder="ENTER EMAIL" required>
</div>
</div>
<div class="form-group">
<label for="mobile"></label>
<input type="text" class="form-control" id="mobile" name="mobile" pattern="[0-9]{10}" maxlength="16" value="" placeholder="ENTER MOBILE NUMBER" required>
</div>
<div class="form-group">
<label for="location"></label>
<input type="text" class="form-control" id="location" name="location" value="" placeholder="ENTER LOCATION" required>
</div>
<div class="form-group">
<select class="form-control" id="program" name="program" required>
<option value="program">SELECT YOUR PROGRAM</option>
<option value="PG Diploma Programs">PG Diploma Programs</option>
<option value="Diploma Programs">Diploma Programs</option>
<option value="Certificate Programs">Certificate Programs</option>
</select>
</div>
<label style="font-color:white;" for="business">PLEASE SELECT YOUR DATE OF BIRTH
<div class="nogap">
<select name="day" class="form-control col-md-4" id="numberRooms">
<option value="dateofbirth">DD</option>
<option value="0">DD</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
<select name="month" class="form-control col-md-4" id="numberBeds">
<option value="0">MM</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
<select class="form-control col-md-4" name="year" id="year">
<option value="0">YYYY</option>
<option value="1960">1960</option>
<option value="1961">1961</option>
<option value="1962">1962</option>
<option value="1963">1963</option>
<option value="1964">1964</option>
<option value="1965">1965</option>
<option value="1966">1966</option>
<option value="1967">1967</option>
<option value="1968">1968</option>
<option value="1969">1969</option>
<option value="1970">1970</option>
<option value="1971">1971</option>
<option value="1972">1972</option>
<option value="1973">1973</option>
<option value="1974">1974</option>
<option value="1975">1975</option>
<option value="1976">1976</option>
<option value="1977">1977</option>
<option value="1978">1978</option>
<option value="1979">1979</option>
<option value="1980">1980</option>
<option value="1981">1981</option>
<option value="1982">1982</option>
<option value="1983">1983</option>
<option value="1984">1984</option>
<option value="1985">1985</option>
<option value="1986">1986</option>
<option value="1987">1987</option>
<option value="1988">1988</option>
<option value="1989">1989</option>
<option value="1990">1990</option>
<option value="1991">1991</option>
<option value="1992">1992</option>
<option value="1993">1993</option>
<option value="1994">1994</option>
<option value="1995">1995</option>
<option value="1996">1996</option>
<option value="1997">1997</option>
<option value="1998">1998</option>
<option value="1999">1999</option>
<option value="2000">2000</option>
</select>
</div>
</label>
<div class="form-group">
<div class="checkbox">
<label><input type="checkbox" name="terms" value="check"><p>I allow NMIMS Distance Learning to contact me to provide details</p></label>
</div>
<div class="wrapper">
<!---<input type="submit" id= "submit" name="submit" value="Submit"/>-->
<input type="submit" id="submit" name="submit" class="btn btn-primary" value="SEND ENQUIRY">
</div>
</div>
</div>
</div>
</aside>
</div>
It looks like you're using Bootstrap as a CSS framework. In that case I would recommend you check their docs on using the Bootstrap grid: https://getbootstrap.com/docs/3.3/examples/grid/
Something similar to the following will give you a responsive 2 column layout
<div class="container">
<div class="row">
<div class="col-sm-6">left column</div>
<div class="col-sm-6">right column</div>
</div>
</div>
To achieve similar using CSS you could do the follow:
.col-1,
.col-2 {
display: inline-block;
width: 50%;
}
#media screen and (max-width: 720px) {
.col-1,
.col-2 {
display: block;
width: 100%;
}
}
This isn't the only way to achieve a 2 column responsive layout but I hope it will give you some pointers. You could also experiment with using floats, flexbox or the newer CSS grid.
It would be worth your time to do some reading up on best practices for your markup and styling. There are a number of issues there that might cause you some issues further on.
I have the following block of code, The problem with this is that it tends to get out of the aircard div when making the screen responsive, I dont know for what reason as shown in the picture,whereas they should stack over one another. What's the reason that they are not being responsive and how can I make them responsive. The code is as follows:
HTML:
<div class="container-fluid">
<div class="air-card">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12 col-xs-offset-0">
<h2 class="text-center hidden-xs m-sm-bottom ng-scope"> Complete Your Account </h2>
<h4 class="text-center ng-binding ng-scope"> Yourname#gmail.com </h4> <br>
<form method="POST" action="confirm.html">
<!--<i class="fas fa-globe">--><select> <!-- </i> -->
<option value="AF">Afghanistan</option>
<option value="AX">Åland Islands</option>
<option value="AL">Albania</option>
</select> <br> <br>
<input type="password" name="" placeholder="Create a Password" required> <br> <br>
<h4 style="text-align: center;"> I want to: </h4>
<div class="btn-group btn-group-lg" align="center" style="margin-left: 400px; position: relative; border: 1px solid black;">
<button type="button" class="btn btn-light">Hire for a Project</button>
<button type="button" class="btn btn-light"> Work as a Freelancer </button>
</div> <br> <br>
<div class="custom-control custom-checkbox" style="margin-left:380px;">
<!--<input type="checkbox" class="custom-control-input" id="customCheck1">
<label class="custom-control-label" for="customCheck1"> <div class="custom-control custom-checkbox">-->
<input type="checkbox" class="custom-control-input" id="customCheck1"">
<label class="custom-control-label" for="customCheck1"> Yes! Send me genuinely useful emails every now and then to help me get the most out of Extolssolutions. </label>
<input type="checkbox" class="custom-control-input" id="customCheck1"">
</div></label>
<div class="custom-control custom-checkbox" style="margin-left:380px;">
<!--<input type="checkbox" class="custom-control-input" id="customCheck1">
<label class="custom-control-label" for="customCheck1"> <div class="custom-control custom-checkbox">-->
<input type="checkbox" class="custom-control-input" id="customCheck1" required>
<label class="custom-control-label" for="customCheck1" required> Yes, I understand and agree to the Extols Solutions Terms of Service , including the User Agreement and Privacy Policy. </label> <br> <br>
<input type="checkbox" class="custom-control-input" id="customCheck1"">
</div>
<button type="submit" class="btn btn-success"> Next </button>
</form>
</div>
</div>
</div>
</div>
CSS:
.air-card {
position: relative;
background-color: #fff;
margin: 30px 0px;
padding: 30px;
box-shadow: 0 1px 6px rgba(57,73,76,.35);
}
select
{
margin-left: 420px;
}
input[type='password']
{
margin-left: 420px;
width: 354px;
}
input[type='checkbox']
{
margin-left: 420px;
text-align: center;
}
label a:hover
{
color: green;
}
button[type='submit']
{
margin-left: 550px;
margin-top: 20px;
width: 8%;
}
.row a
{
color: #747676;
font-family: Arial,sens-serif;
}
JSBIN: http://jsbin.com/dupihupugu/1/edit?html,css,console,output
P.S, I'm relatively a newbie to both CSS,Bootstrap 4 as well as Stack overflow,so please go easy on me
[The full screen page][The responsive screen page]1
Try this
nav
{
background-color: #FFFFFF;
}
nav ul li
{
text-decoration: none;
}
a.navbar-brand
{
margin-left: 100px;
margin-right: 500px;
}
li
{
text-align: right;
}
p
{
display: block;
margin-bottom: 0px;
}
.footer-navbar-wrapper {
background-color: #494949;
}
.copyright
{
color: #E0E0D6;
}
.row a
{
color: #747676;
font-family: Arial,sens-serif;
}
footer
{
padding-top: 40px;
padding-bottom: 20px;
position: relative;
}
.air-card {
position: relative;
background-color: #fff;
margin: 30px 0px;
padding: 30px;
box-shadow: 0 1px 6px rgba(57,73,76,.35);
}
select
{
margin-left: 420px;
}
input[type='password']
{
width: 354px;
}
input[type='checkbox']
{
text-align: center;
}
label a:hover
{
color: green;
}
button[type='submit']
{
margin-top: 20px;
}
<!DOCTYPE html>
<html>
<head>
<title>Signup</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<title> Sign Up Module </title>
<style type="text/css">
</style>
</head>
<body>
<header class="header-navbar-wrapper header-navbar-skinny ng-scope" role="banner" data-ng-controller="headerController">
<nav class="primary-navbar navbar navbar-default" role="navigation">
<a class="navbar-brand" href="#"><img src="logo.jpg"></a>
<ul class="navbar-nav">
<!--<li class="nav-item"> <a class="nav-link" href="#"> <span style="color: #6FDA44"> Extols </span> <span style="color: #4B4B4B"> Solutions</span> </a> </li>-->
<div style="text-align: center;">
<li class="nav-item"> <p> <span class="navbar-text" style="color: #767676">Already Have an Account?</span> <a class="nav-link" href="#" style="color: #178329">Log in</a></p></li>
</div>
</ul>
</nav>
</header>
<div class="container-fluid">
<div class="air-card">
<div class="">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12 col-xs-offset-0">
<h2 class="text-center hidden-xs m-sm-bottom ng-scope"> Complete Your Account </h2>
<h4 class="text-center ng-binding ng-scope"> Yourname#gmail.com </h4> <br>
<form method="POST" action="confirm.html">
<!--<i class="fas fa-globe">--><div align="center">
<select > <!-- </i> -->
<option value="AF">Afghanistan</option>
<option value="AX">Åland Islands</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AS">American Samoa</option>
<option value="AD">Andorra</option>
<option value="AO">Angola</option>
<option value="AI">Anguilla</option>
<option value="AQ">Antarctica</option>
<option value="AG">Antigua and Barbuda</option>
<option value="AR">Argentina</option>
<option value="AM">Armenia</option>
<option value="AW">Aruba</option>
<option value="AU">Australia</option>
<option value="AT">Austria</option>
<option value="AZ">Azerbaijan</option>
<option value="BS">Bahamas</option>
<option value="BH">Bahrain</option>
<option value="BD">Bangladesh</option>
<option value="BB">Barbados</option>
<option value="BY">Belarus</option>
<option value="BE">Belgium</option>
<option value="BZ">Belize</option>
<option value="BJ">Benin</option>
<option value="BM">Bermuda</option>
<option value="BT">Bhutan</option>
<option value="BO">Bolivia, Plurinational State of</option>
<option value="BQ">Bonaire, Sint Eustatius and Saba</option>
<option value="BA">Bosnia and Herzegovina</option>
<option value="BW">Botswana</option>
<option value="BV">Bouvet Island</option>
<option value="BR">Brazil</option>
<option value="IO">British Indian Ocean Territory</option>
<option value="BN">Brunei Darussalam</option>
<option value="BG">Bulgaria</option>
<option value="BF">Burkina Faso</option>
<option value="BI">Burundi</option>
<option value="KH">Cambodia</option>
<option value="CM">Cameroon</option>
<option value="CA">Canada</option>
<option value="CV">Cape Verde</option>
<option value="KY">Cayman Islands</option>
<option value="CF">Central African Republic</option>
<option value="TD">Chad</option>
<option value="CL">Chile</option>
<option value="CN">China</option>
<option value="CX">Christmas Island</option>
<option value="CC">Cocos (Keeling) Islands</option>
<option value="CO">Colombia</option>
<option value="KM">Comoros</option>
<option value="CG">Congo</option>
<option value="CD">Congo, the Democratic Republic of the</option>
<option value="CK">Cook Islands</option>
<option value="CR">Costa Rica</option>
<option value="CI">Côte d'Ivoire</option>
<option value="HR">Croatia</option>
<option value="CU">Cuba</option>
<option value="CW">Curaçao</option>
<option value="CY">Cyprus</option>
<option value="CZ">Czech Republic</option>
<option value="DK">Denmark</option>
<option value="DJ">Djibouti</option>
<option value="DM">Dominica</option>
<option value="DO">Dominican Republic</option>
<option value="EC">Ecuador</option>
<option value="EG">Egypt</option>
<option value="SV">El Salvador</option>
<option value="GQ">Equatorial Guinea</option>
<option value="ER">Eritrea</option>
<option value="EE">Estonia</option>
<option value="ET">Ethiopia</option>
<option value="FK">Falkland Islands (Malvinas)</option>
<option value="FO">Faroe Islands</option>
<option value="FJ">Fiji</option>
<option value="FI">Finland</option>
<option value="FR">France</option>
<option value="GF">French Guiana</option>
<option value="PF">French Polynesia</option>
<option value="TF">French Southern Territories</option>
<option value="GA">Gabon</option>
<option value="GM">Gambia</option>
<option value="GE">Georgia</option>
<option value="DE">Germany</option>
<option value="GH">Ghana</option>
<option value="GI">Gibraltar</option>
<option value="GR">Greece</option>
<option value="GL">Greenland</option>
<option value="GD">Grenada</option>
<option value="GP">Guadeloupe</option>
<option value="GU">Guam</option>
<option value="GT">Guatemala</option>
<option value="GG">Guernsey</option>
<option value="GN">Guinea</option>
<option value="GW">Guinea-Bissau</option>
<option value="GY">Guyana</option>
<option value="HT">Haiti</option>
<option value="HM">Heard Island and McDonald Islands</option>
<option value="VA">Holy See (Vatican City State)</option>
<option value="HN">Honduras</option>
<option value="HK">Hong Kong</option>
<option value="HU">Hungary</option>
<option value="IS">Iceland</option>
<option value="IN">India</option>
<option value="ID">Indonesia</option>
<option value="IR">Iran, Islamic Republic of</option>
<option value="IQ">Iraq</option>
<option value="IE">Ireland</option>
<option value="IM">Isle of Man</option>
<option value="IL">Israel</option>
<option value="IT">Italy</option>
<option value="JM">Jamaica</option>
<option value="JP">Japan</option>
<option value="JE">Jersey</option>
<option value="JO">Jordan</option>
<option value="KZ">Kazakhstan</option>
<option value="KE">Kenya</option>
<option value="KI">Kiribati</option>
<option value="KP">Korea, Democratic People's Republic of</option>
<option value="KR">Korea, Republic of</option>
<option value="KW">Kuwait</option>
<option value="KG">Kyrgyzstan</option>
<option value="LA">Lao People's Democratic Republic</option>
<option value="LV">Latvia</option>
<option value="LB">Lebanon</option>
<option value="LS">Lesotho</option>
<option value="LR">Liberia</option>
<option value="LY">Libya</option>
<option value="LI">Liechtenstein</option>
<option value="LT">Lithuania</option>
<option value="LU">Luxembourg</option>
<option value="MO">Macao</option>
<option value="MK">Macedonia, the former Yugoslav Republic of</option>
<option value="MG">Madagascar</option>
<option value="MW">Malawi</option>
<option value="MY">Malaysia</option>
<option value="MV">Maldives</option>
<option value="ML">Mali</option>
<option value="MT">Malta</option>
<option value="MH">Marshall Islands</option>
<option value="MQ">Martinique</option>
<option value="MR">Mauritania</option>
<option value="MU">Mauritius</option>
<option value="YT">Mayotte</option>
<option value="MX">Mexico</option>
<option value="FM">Micronesia, Federated States of</option>
<option value="MD">Moldova, Republic of</option>
<option value="MC">Monaco</option>
<option value="MN">Mongolia</option>
<option value="ME">Montenegro</option>
<option value="MS">Montserrat</option>
<option value="MA">Morocco</option>
<option value="MZ">Mozambique</option>
<option value="MM">Myanmar</option>
<option value="NA">Namibia</option>
<option value="NR">Nauru</option>
<option value="NP">Nepal</option>
<option value="NL">Netherlands</option>
<option value="NC">New Caledonia</option>
<option value="NZ">New Zealand</option>
<option value="NI">Nicaragua</option>
<option value="NE">Niger</option>
<option value="NG">Nigeria</option>
<option value="NU">Niue</option>
<option value="NF">Norfolk Island</option>
<option value="MP">Northern Mariana Islands</option>
<option value="NO">Norway</option>
<option value="OM">Oman</option>
<option value="PK">Pakistan</option>
<option value="PW">Palau</option>
<option value="PS">Palestinian Territory, Occupied</option>
<option value="PA">Panama</option>
<option value="PG">Papua New Guinea</option>
<option value="PY">Paraguay</option>
<option value="PE">Peru</option>
<option value="PH">Philippines</option>
<option value="PN">Pitcairn</option>
<option value="PL">Poland</option>
<option value="PT">Portugal</option>
<option value="PR">Puerto Rico</option>
<option value="QA">Qatar</option>
<option value="RE">Réunion</option>
<option value="RO">Romania</option>
<option value="RU">Russian Federation</option>
<option value="RW">Rwanda</option>
<option value="BL">Saint Barthélemy</option>
<option value="SH">Saint Helena, Ascension and Tristan da Cunha</option>
<option value="KN">Saint Kitts and Nevis</option>
<option value="LC">Saint Lucia</option>
<option value="MF">Saint Martin (French part)</option>
<option value="PM">Saint Pierre and Miquelon</option>
<option value="VC">Saint Vincent and the Grenadines</option>
<option value="WS">Samoa</option>
<option value="SM">San Marino</option>
<option value="ST">Sao Tome and Principe</option>
<option value="SA">Saudi Arabia</option>
<option value="SN">Senegal</option>
<option value="RS">Serbia</option>
<option value="SC">Seychelles</option>
<option value="SL">Sierra Leone</option>
<option value="SG">Singapore</option>
<option value="SX">Sint Maarten (Dutch part)</option>
<option value="SK">Slovakia</option>
<option value="SI">Slovenia</option>
<option value="SB">Solomon Islands</option>
<option value="SO">Somalia</option>
<option value="ZA">South Africa</option>
<option value="GS">South Georgia and the South Sandwich Islands</option>
<option value="SS">South Sudan</option>
<option value="ES">Spain</option>
<option value="LK">Sri Lanka</option>
<option value="SD">Sudan</option>
<option value="SR">Suriname</option>
<option value="SJ">Svalbard and Jan Mayen</option>
<option value="SZ">Swaziland</option>
<option value="SE">Sweden</option>
<option value="CH">Switzerland</option>
<option value="SY">Syrian Arab Republic</option>
<option value="TW">Taiwan, Province of China</option>
<option value="TJ">Tajikistan</option>
<option value="TZ">Tanzania, United Republic of</option>
<option value="TH">Thailand</option>
<option value="TL">Timor-Leste</option>
<option value="TG">Togo</option>
<option value="TK">Tokelau</option>
<option value="TO">Tonga</option>
<option value="TT">Trinidad and Tobago</option>
<option value="TN">Tunisia</option>
<option value="TR">Turkey</option>
<option value="TM">Turkmenistan</option>
<option value="TC">Turks and Caicos Islands</option>
<option value="TV">Tuvalu</option>
<option value="UG">Uganda</option>
<option value="UA">Ukraine</option>
<option value="AE">United Arab Emirates</option>
<option value="GB">United Kingdom</option>
<option value="US" selected>United States</option>
<option value="UM">United States Minor Outlying Islands</option>
<option value="UY">Uruguay</option>
<option value="UZ">Uzbekistan</option>
<option value="VU">Vanuatu</option>
<option value="VE">Venezuela, Bolivarian Republic of</option>
<option value="VN">Viet Nam</option>
<option value="VG">Virgin Islands, British</option>
<option value="VI">Virgin Islands, U.S.</option>
<option value="WF">Wallis and Futuna</option>
<option value="EH">Western Sahara</option>
<option value="YE">Yemen</option>
<option value="ZM">Zambia</option>
<option value="ZW">Zimbabwe</option>
</select> <br> <br>
</div>
<div align="center">
<input type="password" name="" placeholder="Create a Password" required> <br> <br>
</div>
<div align="left">
<h4 style="text-align: center;"> I want to: </h4>
<div class="btn-group btn-group-lg" align="center" style=" border: 1px solid black;margin-left:21%">
<button type="button" class="btn btn-light">Hire for a Project</button>
<button type="button" class="btn btn-light"> Work as a Freelancer </button>
</div> <br> <br>
<div class="custom-control custom-checkbox" style="margin-left:200px;">
<!--<input type="checkbox" class="custom-control-input" id="customCheck1">
<label class="custom-control-label" for="customCheck1"> <div class="custom-control custom-checkbox">-->
<input type="checkbox" class="custom-control-input" id="customCheck1">
<label class="custom-control-label" for="customCheck1"> Yes! Send me genuinely useful emails every now and then to help me get the most out of Extolssolutions. </label>
<input type="checkbox" class="custom-control-input" id="customCheck1">
</div>
<div class="custom-control custom-checkbox" style="margin-left:200px;">
<label class="custom-control-label" for="customCheck1"> <div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="customCheck1" required>
<label class="custom-control-label" for="customCheck1" required> Yes, I understand and agree to the Extols Solutions Terms of Service , including the User Agreement and Privacy Policy. </label> <br> <br>
<input type="checkbox" class="custom-control-input" id="customCheck1">
</div></div>
<div align="center">
<button type="submit" class="btn btn-success btn-lg"> Next </button>
</div> </form>
</div><br/>
</div>
</div>
</div>
<footer class="footer-navbar-wrapper footer-skinny ng-scope" role="contentinfo" data-ng-controller="footerController">
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<p class="copyright" > © 2015-2018 Extols Solutions Inc </p>
Terms of Service
<br>
Privacy Policy
</div>
</div>
</div>
</footer>
</body>
</html>
I have a form that I am developing and while I can get the form fields to be responsive for width, the textarea box is slightly taller than the select field to the right. How can I make these two the same height while keeping both responsive for mobile?
Here is a codepen of the form. Below is the code:
<div class="row">
<div class="col-md-6">
<div class="control-group">
<div class="form-group floating-label-form-group controls">
<label for="00NW0000001Zjiv" class="control-label" style="font-weight:300">Truck Model(s)</label>
<textarea id="00NW0000001Zjiv" name="00NW0000001Zjiv" type="text" class="form-control input-lg" rows="5"></textarea><span class="help-block bg-danger"></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="control-group">
<div class="form-group floating-label-form-group controls">
<label for="00NW0000001Zjje" class="control-label" style="font-weight:300">State(s) in which the truck(s) run</label>
<select id="00NW0000001Zjje" name="00NW0000001Zjje" multiple="multiple" class="form-control input-lg">
<option value="Alabama">Alabama</option>
<option value="Alaska">Alaska</option>
<option value="Arizona">Arizona</option>
<option value="Arkansas">Arkansas</option>
<option value="California">California</option>
<option value="Colorado">Colorado</option>
<option value="Connecticut">Connecticut</option>
<option value="Delaware">Delaware</option>
<option value="Florida">Florida</option>
<option value="Georgia">Georgia</option>
<option value="Hawaii">Hawaii</option>
<option value="Idaho">Idaho</option>
<option value="Illinois">Illinois</option>
<option value="Indiana">Indiana</option>
<option value="Iowa">Iowa</option>
<option value="Kansas">Kansas</option>
<option value="Kentucky">Kentucky</option>
<option value="Louisiana">Louisiana</option>
<option value="Maine">Maine</option>
<option value="Maryland">Maryland</option>
<option value="Massachusetts">Massachusetts</option>
<option value="Michigan">Michigan</option>
<option value="Minnesota">Minnesota</option>
<option value="Mississippi">Mississippi</option>
<option value="Missouri">Missouri</option>
<option value="Montana">Montana</option>
<option value="Nebraska">Nebraska</option>
<option value="Nevada">Nevada</option>
<option value="New Hampshire">New Hampshire</option>
<option value="New Jersey">New Jersey</option>
<option value="New Mexico">New Mexico</option>
<option value="New York">New York</option>
<option value="North Carolina">North Carolina</option>
<option value="North Dakota">North Dakota</option>
<option value="Ohio">Ohio</option>
<option value="Oklahoma">Oklahoma</option>
<option value="Oregon">Oregon</option>
<option value="Pennsylvania">Pennsylvania</option>
<option value="Rhode Island">Rhode Island</option>
<option value="South Carolina">South Carolina</option>
<option value="South Dakota">South Dakota</option>
<option value="Tennessee">Tennessee</option>
<option value="Texas">Texas</option>
<option value="Utah">Utah</option>
<option value="Vermont">Vermont</option>
<option value="Virginia">Virginia</option>
<option value="Washington">Washington</option>
<option value="West Virginia">West Virginia</option>
<option value="Wisconsin">Wisconsin</option>
<option value="Wyoming">Wyoming</option>
</select><span class="help-block bg-danger"></span>
</div>
</div>
</div>
</div>
Thanks!
It is possible by giving manually height to textarea. So give height to textarea on media queries.
In this way you would be able to achieve the responsiveness as well.
I hope this might help you
JSFiddle Link
<div class="row">
<div class="left">
<label for="first-name">First Name</label>
<input type="text" name="first-name" placeholder="First Name" id="first-name" required="required" />
</div>
<div class="right">
<label for="details">Details</label>
<textarea name="details" placeholder="Details" id="details" required></textarea>
</div>
</div>
CSS:
#media only screen and (min-width: 600px) {
textarea { height: calc(100% - 0.75em); /* 100% fill height, minus height of details label */ }
}
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sell</title>
<link rel="stylesheet" type="text/css" href="../Web6/Web6.css"/>
</head>
<body>
<center><h1>Video Games for Sale</h1></center>
<center><h4>(This is for a school project only. Any of these items can not actually be purchased by an individual.)</h4></center>
<div><label class="field-label">First name:</label><input type="text" name="firstname" /></div><br/>
<div><label class="field-label">Last Name:</label><input type="text" name="lastname" /></div>
<p>
<img src="SotC.jpg" alt="Shadow of the Colossus" /><input type="checkbox" name="games[]" value="shadowofthecolossus"/>
Shadow of the Colossus - $20 <br/>
<img src="GoW.jpg" alt="God of War" /><input type="checkbox" name="games[]" value="godofwar" />
God of War - $15 <br/>
<img src="HL.jpg" alt="Half-life" /><input type="checkbox" name="games[]" value="halflife" />
Half-Life - $10 <br/>
</p>
<p id="description">This website is for the sale of 3 particularly good video games. The first one Shadow of the Colossus where you play a character Wander who is set<br/> on a quest to slay 16 Gigantic Colossus to bring back his love. Another game for sale is God of War, where you play as Spartan warrior Kratoes<br/> who is betrayed by the God of War Ares which sets up an Epic revenge tale. Finally Half-Life in which you play as scientist Gordon Freeman who<br/> was involved in a science experiment gone wrong and has to survive not only alien creatures let in, but also the military trying to quarentine the area.
</p>
<label class="field-label">Street:</label><input type="text" name="street" /><br/>
<label class="field-label">City:</label><input type="text" name="city" /><br/>
<label class="field-label" id="state">State:</label><select name="state">
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="DC">District Of Columbia</option>
<option value="FL">Florida</option>
<option value="GA">Georgia</option>
<option value="HI">Hawaii</option>
<option value="ID">Idaho</option>
<option value="IL">Illinois</option>
<option value="IN">Indiana</option>
<option value="IA">Iowa</option>
<option value="KS">Kansas</option>
<option value="KY">Kentucky</option>
<option value="LA">Louisiana</option>
<option value="ME">Maine</option>
<option value="MD">Maryland</option>
<option value="MA">Massachusetts</option>
<option value="MI">Michigan</option>
<option value="MN">Minnesota</option>
<option value="MS">Mississippi</option>
<option value="MO">Missouri</option>
<option value="MT">Montana</option>
<option value="NE">Nebraska</option>
<option value="NV">Nevada</option>
<option value="NH">New Hampshire</option>
<option value="NJ">New Jersey</option>
<option value="NM">New Mexico</option>
<option value="NY">New York</option>
<option value="NC">North Carolina</option>
<option value="ND">North Dakota</option>
<option value="OH">Ohio</option>
<option value="OK">Oklahoma</option>
<option value="OR">Oregon</option>
<option value="PA">Pennsylvania</option>
<option value="RI">Rhode Island</option>
<option value="SC">South Carolina</option>
<option value="SD">South Dakota</option>
<option value="TN">Tennessee</option>
<option value="TX">Texas</option>
<option value="UT">Utah</option>
<option value="VT">Vermont</option>
<option value="VA">Virginia</option>
<option value="WA">Washington</option>
<option value="WV">West Virginia</option>
<option value="WI">Wisconsin</option>
<option value="WY">Wyoming</option>
</select><br/>
<label class="field-label">Zip Code:</label><input type="text" name="zip" /><br/>
Credit Card Type:<br/>
<input type="radio" name="card" value="mastercard" checked="checked"/>Master Card<br/>
<input type="radio" name="card" value="visacard" />Visa Card<br/>
<input type="radio" name="card" value="expresscard" />American Express<br/>
<input type="submit" />
<input type="reset" />
</form>
</body>
</html>
CSS
#charset "utf-8";
/* CSS Document */
.field-label {
display: inline-block;
width: 5%;
text-align: left;
}
img {width:1%;
height:1%;
}
#description {text-align:right;
z-index:1;
}
If you go to this website the text is to the right, but the left side now has a huge gab. How would I fix this within CSS? If not possible how would I fix it through HTML? I am trying to submit a site to sell materials (video games). I will be adding links on the name of the games later on to describe them, which is more than what is asked. This is my biggest issue though. I have asked, but nothing stopped the gap on the right.
Example: http://jsfiddle.net/ethbz5gn/1/
It's because of the <br> tags that have been manually implemented everywhere inside the <p id="description"> tag. Remove all br tags and it does what you want.
I would change few things. The center tag is obsolete, get rid of it and use CSS. The br tag has no semantic meaning and is almost impossible to style, so get rid of that and replace with div if needed to separate elements. It is also better to let text flow naturally.
Learn how label works. It either uses an id of an element or wraps it. This does a few things, it helps with accessibility and also provides an additional action point. For example clicking on the label will bring focus to the element or click a radio or check-box.
Also learn about floats, which is what I've used to move your text to the right.
So here is the code:
h1, h4 {text-align:center;} /*Replace the center tag with css*/
.field-label {
display: inline-block;
width: 15%;
text-align: left;
}
/*Get rid of list bullets and paddin when in field set*/
fieldset ul {list-style:none; padding:0;}
img {width:1%;
height:1%;
}
form{float:left; width:50%;}
#description {text-align:right;
z-index:1;
float:right;
width:50%;
}
<h1>Video Games for Sale</h1>
<h4>(This is for a school project only. Any of these items can not actually be purchased by an individual.)</h4>
<p id="description">This website is for the sale of 3 particularly good video games. The first one Shadow of the Colossus where you play a character Wander who is set on a quest to slay 16 Gigantic Colossus to bring back his love. Another game for sale is God of War, where you play as Spartan warrior Kratoes who is betrayed by the God of War Ares which sets up an Epic revenge tale. Finally Half-Life in which you play as scientist Gordon Freeman who was involved in a science experiment gone wrong and has to survive not only alien creatures let in, but also the military trying to quarentine the area.
</p>
<form action="#">
<fieldset>
<legend>Personal Details</legend>
<div class="frmRow"><label class="field-label" for="firstname">First name:</label><input type="text" id="firstname" name="firstname" /></div>
<div class="frmRow"><label class="field-label" for="lastname">Last Name:</label><input type="text" id="lastname" name="lastname" /></div>
</fieldset>
<fieldset id="selGames">
<legend>Games</legend>
<!-- Looks Like a list, so lets make it a list -->
<ul>
<li>
<label for="SotC">
<img src="SotC.jpg" alt="Shadow of the Colossus" />
</label>
<input type="checkbox" id="SotC" name="games[]" value="shadowofthecolossus"/>
<label for="SotC">Shadow of the Colossus - $20</label>
</li>
<li>
<label for="GoW">
<img src="GoW.jpg" alt="God of War" />
</label>
<input type="checkbox" name="games[]" id="GoW" value="godofwar" />
<label for="GoW">God of War - $15</label>
</li>
<li>
<label for="HL">
<img src="HL.jpg" alt="Half-life" />
</label>
<input type="checkbox" id="HL" name="games[]" value="halflife" />
<label for="HL">Half-Life - $10</label>
</li>
</ul>
</fieldset>
<fieldset id="addressDetails">
<legend>Address</legend>
<div class="frmRow"><label class="field-label" for="street">Street:</label><input type="text" name="street" id="street" /></div>
<div class="frmRow"><label class="field-label" for="city">City:</label><input type="text" name="city" id="city" /></div>
<div class="frmRow"><label class="field-label" for="state">State:</label><select id="state" name="state">
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="DC">District Of Columbia</option>
<option value="FL">Florida</option>
<option value="GA">Georgia</option>
<option value="HI">Hawaii</option>
<option value="ID">Idaho</option>
<option value="IL">Illinois</option>
<option value="IN">Indiana</option>
<option value="IA">Iowa</option>
<option value="KS">Kansas</option>
<option value="KY">Kentucky</option>
<option value="LA">Louisiana</option>
<option value="ME">Maine</option>
<option value="MD">Maryland</option>
<option value="MA">Massachusetts</option>
<option value="MI">Michigan</option>
<option value="MN">Minnesota</option>
<option value="MS">Mississippi</option>
<option value="MO">Missouri</option>
<option value="MT">Montana</option>
<option value="NE">Nebraska</option>
<option value="NV">Nevada</option>
<option value="NH">New Hampshire</option>
<option value="NJ">New Jersey</option>
<option value="NM">New Mexico</option>
<option value="NY">New York</option>
<option value="NC">North Carolina</option>
<option value="ND">North Dakota</option>
<option value="OH">Ohio</option>
<option value="OK">Oklahoma</option>
<option value="OR">Oregon</option>
<option value="PA">Pennsylvania</option>
<option value="RI">Rhode Island</option>
<option value="SC">South Carolina</option>
<option value="SD">South Dakota</option>
<option value="TN">Tennessee</option>
<option value="TX">Texas</option>
<option value="UT">Utah</option>
<option value="VT">Vermont</option>
<option value="VA">Virginia</option>
<option value="WA">Washington</option>
<option value="WV">West Virginia</option>
<option value="WI">Wisconsin</option>
<option value="WY">Wyoming</option>
</select></div>
<div class="frmRow"><label class="field-label" for="zip">Zip Code:</label><input type="text" id="zip" name="zip" /></div>
</fieldset>
<fieldset>
<legend>Credit Card Type</legend>
<!--Again this looks like a list-->
<ul>
<li><input type="radio" name="card" id="mc" value="mastercard" checked="checked"/><label for="mc">Master Card</label></li>
<li><input type="radio" name="card" id="vc" value="visacard" /><label for="vc">Visa Card</label></li>
<li><input type="radio" name="card" id="amex" value="expresscard" /><label for="amex">American Express</label></li>
</ul>
</fieldset>
<input type="submit" />
<input type="reset" />