Button inside child divs at the same position - html

I have 3 childs divs with each possessing a button element inside like showed by the following picture:
Code:
body {
background-color: white;
}
input,
select,
textarea {
width: 100%;
padding: 6px;
border: 1px solid #ccc;
border-radius: 5px;
}
label {
padding: 12px 12px 12px 0;
display: flex;
flex-direction: column;
}
.Order_Create_Ship_Stock>div {
display: table-cell;
width: 10%;
margin: 5px;
border: solid;
}
.Order_Create_Ship_Stock {
display: inline-table;
border-spacing: 10px;
}
.Order_Create,
.Order_Ship,
.Order_Store {
border-radius: 5px;
background-color: #f2f2f2;
padding: 10px;
}
#SubmitCreateOrder,
#SubmitShipOrder,
#SubmitStoreOrder {
transition-duration: 0.4s;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
color: black;
border: 2px solid #4caf50;
border-radius: 6px;
font-size: 14px;
cursor: pointer;
display: flex;
flex-direction: column;
margin: auto;
}
#SubmitCreateOrder:hover {
background-color: #4caf50;
color: white;
}
#SubmitShipOrder:hover {
background-color: #4caf50;
color: white;
}
#SubmitStoreOrder:hover {
background-color: #4caf50;
color: white;
}
<div id="OrderCreateShipStock" class="Order_Create_Ship_Stock">
<div id="OrderCreate" class="Order_Create">
<form onsubmit="App.createOrder(); return false">
<label for="BarcodeInput">
<span>Barcode</span>
<input
name="BarcodeInput"
id="Barcode"
class="Barcorde"
type="text"
placeholder="Order's Barcode..."
/>
</label>
<label for="OwnerInput">
<span>Owner</span>
<input
name="OwnerInput"
id="Owner"
class="Owner"
type="text"
placeholder="Owner of the product..."
/>
</label>
<label for="ProductListInput">
<span>Product list</span>
<input
name="ProductListInput"
id="ProductList"
class="Product_List"
type="text"
placeholder="Product list of the order...."
/>
</label>
<label for="ExpirationDateInput">
<span>Expiration date</span>
<input
name="ExpirationDateInput"
id="ExpirationDate"
class="Expiration_Date"
type="date"
/>
</label>
<label for="TemperatureMinimalInput">
<span>Temperature minimal</span>
<input
name="TemperatureMinimalInput"
id="TemperatureMinimal"
class="Temperature_Minimal"
type="number"
placeholder="Minimal temperature of order's environment..."
/>
</label>
<label for="TemperatureMaximalInput">
<span>Temperature maximal</span>
<input
name="TemperatureMaximalInput"
id="TemperatureMaximal"
class="Temperature_Maximal"
type="number"
placeholder="Maximal temperature of order's environment..."
/>
</label>
<label for="IOTDeviceInput">
<span>IOT Device</span>
<select name="IOTDeviceInput" id="IOTDevice" class="IOT_Device">
<option value="">---Please select an IOT Device---</option>
</select>
</label>
<label for="FinalDestinationInput">
<span>Final destination</span>
<input
name="FinalDestinationInput"
id="FinalDestination"
class="Final_Destination"
type="text"
placeholder="Order's final destination..."
/>
</label>
<button id="SubmitCreateOrder" class="Submit_Create_Order" type="submit">
Create Order
</button>
</form>
</div>
<div id="OrderShip" class="Order_Ship">
<form onsubmit="App.ShipOrder(); return false">
<label for="OrderIDInput">
<span>OrderID</span>
<input
name="OrderIDInput"
id="OrderID"
class="Order_ID"
type="text"
placeholder="Order's ID"
/>
</label>
<label for="ActualLocationInput">
<span>Actual location</span>
<input
name="ActualLocationInput"
id="ActualLocation"
class="Actual_Location_Input"
type="text"
placeholder="Order's actual location"
/>
</label>
<label for="ActualTemperatureInput">
<span>Actual temperature</span>
<input
name="ActualTemperatureInput"
id="ActualTemperature"
class="Actual_Temperature"
type="text"
placeholder="Order's actual environment temperature"
/>
</label>
<label for="CurrentCounterpartyInput">
<span>Counterparty</span>
<input
name="CurrentCounterpartyInput"
id="CurrentCounterparty"
class="Current_Counterparty"
type="text"
placeholder="Order's current counterparty"
/>
</label>
<label for="IOTDeviceInput">
<span>IOT Device</span>
<select
name="IOTDeviceInput"
id="IOTDevice"
class="IOT_Device_Input"
>
</select>
</label>
<label for="AnticipatedDateInput">
<span>Anticipated date</span>
<input
name="AnticipatedDateInput"
id="AnticipatedDate"
class="Anticipated_Date"
type="date"
/>
</label>
<label for="DestinationInput">
<span>Destination</span>
<input
name="DestinationInput"
id="Destination"
class="Destination_"
type="text"
placeholder="Order's destination"
/>
</label>
<button id="SubmitShipOrder" class="Submit_Ship_Order" type="submit">
Ship Order
</button>
</form>
</div>
<div id="OrderStore" class="Order_Store">
<form onsubmit="App.storeOrder(); return false">
<label for="OrderIDInput">
<span>OrderID</span>
<input
name="OrderIDInput"
id="OrderID"
class="Order_ID"
type="text"
placeholder="Order's ID"
/>
</label>
<label for="ActualLocationInput">
<span>Actual location</span>
<input
name="ActualLocationInput"
id="ActualLocation"
class="Actual_Location_Input"
type="text"
placeholder="Order's actual location"
/>
</label>
<label for="ActualTemperatureInput">
<span>Actual temperature</span>
<input
name="ActualTemperatureInput"
id="ActualTemperature"
class="Actual_Temperature"
type="text"
placeholder="Order's actual environment temperature"
/>
</label>
<label for="CurrentCounterpartyInput">
<span>Counterparty</span>
<input
name="CurrentCounterpartyInput"
id="CurrentCounterparty"
class="Current_Counterparty"
type="text"
placeholder="Order's current counterparty"
/>
</label>
<!-- Your Stuff -->
<label for="IOTDeviceInput">
<span>IOT Device</span>
<select
name="IOTDeviceInput"
id="IOTDevice"
class="IOT_Device_Input"
>
<option value="">---Please select an IOT Device---</option>
</select>
</label>
<button id="SubmitStoreOrder" class="Submit_Store_Order" type="submit">
Store Order
</button>
</form>
</div>
</div>
I basically want that the Ship Order and Store Order button are positioned at the same height. I followed the advice from some other posts like using justify-content: flex-end, but they didn't work...
I thank in advance anybody who will help me :).

It's probably not the best solution, but working.
So you can play a bit with it.
I added
.Order_Create,
.Order_Ship,
.Order_Store {
...
padding: 20px 10px;
position:relative;
}
and
#SubmitCreateOrder,
#SubmitShipOrder,
#SubmitStoreOrder {
...
margin: auto;
position: absolute;
bottom: 5px;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
}
body {
background-color: white;
}
input,
select,
textarea {
width: 100%;
padding: 6px;
border: 1px solid #ccc;
border-radius: 5px;
}
label {
padding: 12px 12px 12px 0;
display: flex;
flex-direction: column;
}
.Order_Create_Ship_Stock>div {
display: table-cell;
width: 10%;
margin: 5px;
border: solid;
}
.Order_Create_Ship_Stock {
display: inline-table;
border-spacing: 10px;
}
.Order_Create,
.Order_Ship,
.Order_Store {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px 10px;
position:relative;
}
#SubmitCreateOrder,
#SubmitShipOrder,
#SubmitStoreOrder {
transition-duration: 0.4s;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
color: black;
border: 2px solid #4caf50;
border-radius: 6px;
font-size: 14px;
cursor: pointer;
margin: auto;
position: absolute;
bottom: 5px;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
}
#SubmitCreateOrder:hover {
background-color: #4caf50;
color: white;
}
#SubmitShipOrder:hover {
background-color: #4caf50;
color: white;
}
#SubmitStoreOrder:hover {
background-color: #4caf50;
color: white;
}
<div id="OrderCreateShipStock" class="Order_Create_Ship_Stock">
<div id="OrderCreate" class="Order_Create">
<form onsubmit="App.createOrder(); return false">
<label for="BarcodeInput">
<span>Barcode</span>
<input
name="BarcodeInput"
id="Barcode"
class="Barcorde"
type="text"
placeholder="Order's Barcode..."
/>
</label>
<label for="OwnerInput">
<span>Owner</span>
<input
name="OwnerInput"
id="Owner"
class="Owner"
type="text"
placeholder="Owner of the product..."
/>
</label>
<label for="ProductListInput">
<span>Product list</span>
<input
name="ProductListInput"
id="ProductList"
class="Product_List"
type="text"
placeholder="Product list of the order...."
/>
</label>
<label for="ExpirationDateInput">
<span>Expiration date</span>
<input
name="ExpirationDateInput"
id="ExpirationDate"
class="Expiration_Date"
type="date"
/>
</label>
<label for="TemperatureMinimalInput">
<span>Temperature minimal</span>
<input
name="TemperatureMinimalInput"
id="TemperatureMinimal"
class="Temperature_Minimal"
type="number"
placeholder="Minimal temperature of order's environment..."
/>
</label>
<label for="TemperatureMaximalInput">
<span>Temperature maximal</span>
<input
name="TemperatureMaximalInput"
id="TemperatureMaximal"
class="Temperature_Maximal"
type="number"
placeholder="Maximal temperature of order's environment..."
/>
</label>
<label for="IOTDeviceInput">
<span>IOT Device</span>
<select name="IOTDeviceInput" id="IOTDevice" class="IOT_Device">
<option value="">---Please select an IOT Device---</option>
</select>
</label>
<label for="FinalDestinationInput">
<span>Final destination</span>
<input
name="FinalDestinationInput"
id="FinalDestination"
class="Final_Destination"
type="text"
placeholder="Order's final destination..."
/>
</label>
<button id="SubmitCreateOrder" class="Submit_Create_Order" type="submit">
Create Order
</button>
</form>
</div>
<div id="OrderShip" class="Order_Ship">
<form onsubmit="App.ShipOrder(); return false">
<label for="OrderIDInput">
<span>OrderID</span>
<input
name="OrderIDInput"
id="OrderID"
class="Order_ID"
type="text"
placeholder="Order's ID"
/>
</label>
<label for="ActualLocationInput">
<span>Actual location</span>
<input
name="ActualLocationInput"
id="ActualLocation"
class="Actual_Location_Input"
type="text"
placeholder="Order's actual location"
/>
</label>
<label for="ActualTemperatureInput">
<span>Actual temperature</span>
<input
name="ActualTemperatureInput"
id="ActualTemperature"
class="Actual_Temperature"
type="text"
placeholder="Order's actual environment temperature"
/>
</label>
<label for="CurrentCounterpartyInput">
<span>Counterparty</span>
<input
name="CurrentCounterpartyInput"
id="CurrentCounterparty"
class="Current_Counterparty"
type="text"
placeholder="Order's current counterparty"
/>
</label>
<label for="IOTDeviceInput">
<span>IOT Device</span>
<select
name="IOTDeviceInput"
id="IOTDevice"
class="IOT_Device_Input"
>
</select>
</label>
<label for="AnticipatedDateInput">
<span>Anticipated date</span>
<input
name="AnticipatedDateInput"
id="AnticipatedDate"
class="Anticipated_Date"
type="date"
/>
</label>
<label for="DestinationInput">
<span>Destination</span>
<input
name="DestinationInput"
id="Destination"
class="Destination_"
type="text"
placeholder="Order's destination"
/>
</label>
<button id="SubmitShipOrder" class="Submit_Ship_Order" type="submit">
Ship Order
</button>
</form>
</div>
<div id="OrderStore" class="Order_Store">
<form onsubmit="App.storeOrder(); return false">
<label for="OrderIDInput">
<span>OrderID</span>
<input
name="OrderIDInput"
id="OrderID"
class="Order_ID"
type="text"
placeholder="Order's ID"
/>
</label>
<label for="ActualLocationInput">
<span>Actual location</span>
<input
name="ActualLocationInput"
id="ActualLocation"
class="Actual_Location_Input"
type="text"
placeholder="Order's actual location"
/>
</label>
<label for="ActualTemperatureInput">
<span>Actual temperature</span>
<input
name="ActualTemperatureInput"
id="ActualTemperature"
class="Actual_Temperature"
type="text"
placeholder="Order's actual environment temperature"
/>
</label>
<label for="CurrentCounterpartyInput">
<span>Counterparty</span>
<input
name="CurrentCounterpartyInput"
id="CurrentCounterparty"
class="Current_Counterparty"
type="text"
placeholder="Order's current counterparty"
/>
</label>
<!-- Your Stuff -->
<label for="IOTDeviceInput">
<span>IOT Device</span>
<select
name="IOTDeviceInput"
id="IOTDevice"
class="IOT_Device_Input"
>
<option value="">---Please select an IOT Device---</option>
</select>
</label>
<button id="SubmitStoreOrder" class="Submit_Store_Order" type="submit">
Store Order
</button>
</form>
</div>
</div>

Related

How to align-text left for radio button and checkboxes, after centering everything

I have 2 questions really. How can I align my radio buttons and checkboxes to the left of my already centered form-group in css.They are currently all center, but I want the checkboxes and radio buttons to be aligned to the left, but still in center. Also how can I make my form take up the whole page with a scroll bar like the example I will provide. everything current just sits at the top of page. Please let me know of any questions, really am stuck here and just need a little nudge. Thanks.
Example: https://survey-form.freecodecamp.rocks/
.text-center {
text-align: center;
margin: auto;
}
.form-group {
text-align: center;
margin: auto;
}
.clue {
text-align: center;
}
.input-checkboxes {
text-align: center;
}
* {
box-sizing: border-box;
box-sizing: inherit;
margin: 0;
padding: 0;
font-family: lato, arial;
}
body {
background: url(images/tech2.webp);
background-size: 100%;
height: 100%;
}
.container {
grid-column: 5 / 9;
max-width: 600px;
margin: 20px auto 20px;
padding: 30px 30px 30px 30px;
border: 1px solid black;
border-radius: 8px;
background-color: rgba(255, 255, 255, 0.763);
}
header {
text-align: center;
padding-top: 20px;
padding-bottom: 20px;
}
h1 {
margin-bottom: 5px;
}
.checkbox,
.radio-button {
display: block;
}
.form-grou>.inline {
margin-right: 6px;
text-align: left;
}
#submit {
font-size: 16px;
display: block;
margin: 0 auto;
background: #2f80ed;
color: white;
border: none;
border-radius: 6px;
padding: 10px 24px;
}
#media only screen and (max-width: 1000px) {
.container {
grid-column: 1 / 12;
}
}
<header class="header">
<h1 id="title" class="text-center">Survey Form</h1>
<p id="description" class="description text-center">Thank you for taking the time to help me improve my skills as a developer</p>
</header>
<div class="container">
<form id="survey-form">
<div class="form-group">
<label id="name-label" for="name">Name:
<input
required
id="name"
for="name"
type="text"
placeholder="Name"></label><br/>
</div>
<div class="form-group">
<label id="email-label" for="email">Email:
<input
required
id="email"
type="email"
placeholder="E-mail"></label><br/>
</div>
<div class="form-group">
<label id="number-label" for="numebr">Age:
<input
required
id="number"
min="13"
max="120" type="number"
placeholder="Age"></label><br/>
</div>
<div class="form-group">
<p>Which option best describes your current role?</p>
<select for="dropdown" id="dropdown" name="role" class="form-control" required>
<option disabled selected>Seelct current role</option>
<option value="student">Student</option>
<option value="teacher">Teacher</option>
<option value="job">Full time job coding</option>
<option value="preferNo">Prefer not to say</option>
<option value="other">Other</option>
</select><br/>
</div>
<div class="form-group">
<label> Based on my portfolio/resume, would you say that I am job ready?<br/>
<input
type="radio"
name="referal"
class="inline"
value="definitely" /> Definitely</label><br/>
<label>
<input
type="radio"
name="referal"
class="inline"
value="maybe" /> Maybe</label><br/>
<label>
<input
type="radio"
name="referal"
class="inline"
value="definitelyNot"/> Definitely not
</label><br/>
</div>
<div class="form-group">
<label>In your opinion, what would you say is my strongest skill?<br/>
<select id="improved" name="improved" class="form-control" required>
<option disabled selected>Seelct an option</option>
<option value="html/css">HTML/CSS</option>
<option value="javascript">Javascript</option>
<option value="ui/ux">UI/UX Design</option>
<option value="response">Responsiveness/Functionability</option>
<option>Project Ideas</option>
</select><br/>
</label>
</div>
<div class="form-group">
<p>What would you like to see improved? <span class="clue">(Check all that apply)</span></p>
<label>
<input
type="checkbox"
name="improved"
class="input-checkbox"
value="frontend"/> Front-End skills<br/>
<input
type="checkbox"
name="improved"
class="input-checkbox"
value="backend" /> Back-End skills<br/>
<input
type="checkbox"
name="improved"
class="input-checkbox"
value="ui/ux"/> UI/UX Design<br/>
<input
type="checkbox"
name="improved"
class="input-checkbox"
value="response"/> Responsiveness/Functionality<br/>
<input
type="checkbox"
name="improved"
class="input-checkbox"
value="response" /> Project Ideas<br/>
<input
type="checkbox"
name="improved"
class="input-checkbox"
value="number"/> Number of Projects<br/>
</label>
</div>
<div class="form-group">
<p>Any other comments or suggestions?</p>
<textarea name="comments" id="comments" rows="3" cols="30" class="input-textarea" placeholder="Enter your comments here..."></textarea>
</div>
<div class="form-group">
<button type="submit" id="submit" class="submit-button">Submit
</button>
</div>
</div>
</form>
</div>
You gave the div with the radio buttons the class .form-group. This class has a property align-center if you remove that from the div the buttons will align to the left.
If you give the .text-center to the <p> the tekst will align center
.text-center{
text-align: center;
margin: auto;
}
.form-group{
text-align: center;
margin: auto;
}
.clue{
text-align: center;
}
.input-checkboxes{
text-align: center;
}
* {
box-sizing: border-box;
box-sizing: inherit;
margin: 0;
padding: 0;
font-family: lato, arial;}
body{
background: url(images/tech2.webp);
background-size: 100%;
height: 100%;
}
.container{
grid-column: 5 / 9;
max-width: 600px;
margin: 20px auto 20px;
padding: 30px 30px 30px 30px;
border: 1px solid black;
border-radius: 8px;
background-color: rgba(255, 255, 255, 0.763);
}
header{
text-align: center;
padding-top: 20px;
padding-bottom: 20px;
}
h1{
margin-bottom: 5px;
}
.checkbox, .radio-button {
display: block;
}
.form-grou > .inline {
margin-right: 6px;
text-align: left;
}
#submit {
font-size: 16px;
display: block;
margin: 0 auto;
background: #2f80ed;
color: white;
border: none;
border-radius: 6px;
padding: 10px 24px;
}
#media only screen and (max-width: 1000px) {
.container {
grid-column: 1 / 12;
}
}
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css">
<title>Survey</title>
</head>
<header class="header">
<h1 id="title" class="text-center">Survey Form</h1>
<p id="description" class="description text-center">Thank you for taking the time to help me improve my skills as a developer</p>
</header>
<div class="container">
<form id="survey-form">
<div class="form-group">
<label id="name-label" for="name">Name:
<input
required
id="name"
for="name"
type="text"
placeholder="Name"></label><br/>
</div>
<div class="form-group">
<label id="email-label" for="email">Email:
<input
required
id="email"
type="email"
placeholder="E-mail"></label><br/>
</div>
<div class="form-group">
<label id="number-label" for="numebr">Age:
<input
required
id="number"
min="13"
max="120" type="number"
placeholder="Age"></label><br/>
</div>
<div class="form-group">
<p>Which option best describes your current role?</p>
<select for="dropdown" id="dropdown" name="role" class="form-control" required>
<option disabled selected>Seelct current role</option>
<option value="student">Student</option>
<option value="teacher">Teacher</option>
<option value="job">Full time job coding</option>
<option value="preferNo">Prefer not to say</option>
<option value="other">Other</option>
</select><br/>
</div>
<div>
<label> <p class="text-center">Based on my portfolio/resume, would you say that I am job ready?<br/> </p>
<input
type="radio"
name="referal"
class="inline"
value="definitely" /> Definitely</label><br/>
<label>
<input
type="radio"
name="referal"
class="inline"
value="maybe" /> Maybe</label><br/>
<label>
<input
type="radio"
name="referal"
class="inline"
value="definitelyNot"/> Definitely not
</label><br/>
</div>
<div class="form-group">
<label>In your opinion, what would you say is my strongest skill?<br/>
<select id="improved" name="improved" class="form-control" required>
<option disabled selected>Seelct an option</option>
<option value="html/css">HTML/CSS</option>
<option value="javascript">Javascript</option>
<option value="ui/ux">UI/UX Design</option>
<option value="response">Responsiveness/Functionability</option>
<option>Project Ideas</option>
</select><br/>
</label>
</div>
<div>
<p class="text-center" >What would you like to see improved? <span class="clue">(Check all that apply)</span></p>
<label>
<input
type="checkbox"
name="improved"
class="input-checkbox"
value="frontend"/> Front-End skills<br/>
<input
type="checkbox"
name="improved"
class="input-checkbox"
value="backend" /> Back-End skills<br/>
<input
type="checkbox"
name="improved"
class="input-checkbox"
value="ui/ux"/> UI/UX Design<br/>
<input
type="checkbox"
name="improved"
class="input-checkbox"
value="response"/> Responsiveness/Functionality<br/>
<input
type="checkbox"
name="improved"
class="input-checkbox"
value="response" /> Project Ideas<br/>
<input
type="checkbox"
name="improved"
class="input-checkbox"
value="number"/> Number of Projects<br/>
</label>
</div>
<div class="form-group">
<p>Any other comments or suggestions?</p>
<textarea
name="comments"
id="comments"
rows="3"
cols="30"
class="input-textarea"
placeholder="Enter your comments here..."></textarea>
</div>
<div class="form-group">
<button
type="submit"
id="submit"
class="submit-button">Submit
</button>
</div>
</div>
</form>
</div>
Remove the css of .text-center and .form-group

How to align your form element with CSS?

So I have created a form with different type of elements (including radio, checkbox, text input etc.) and I cannot figure out how to make the whole form look neat. Ideally I want all labels aligned on the left side, except labels for radio buttons which should be aligned with the input fields.
My pen:
https://codepen.io/andreas-soteriou/pen/NWwEywR?editors=1100
I coloured the labels and inputs, for me to visualise as I am fairly new to this!
<header>
<h1 id="title">Print selection</h1>
<p id="description">Tailor your prints</p>
</header>
<body>
<main>
<form id="survey-form">
<h2 class="selection">start your selection here</h2>
<label id="label-input" for="name">Name:</label>
<input class="input" id="name" type="text" name="name" placeholder="First Last" required>
<br>
<label id="email-input" for="email">E-mail:</label>
<input id="email" type="text" name="email" placeholder="first.last#gmail.com" required>
<br>
<label id="number-input" for="number">Age:</label>
<input id="number" type="number" name="number" min="18" max="99" required>
<br>
<label for="dropdown">Select frame:</label>
<select id="dropdown" name="frames">
<option value="gold frame">Gold</option>
<option value="metallic frame">Metallic</option>
<option value="wooden frame">Wooden</option>
</select>
<br>
<!--RADIO--->
<label>Size of print:</label>
<br>
<input id="print_size" type="radio" name="print_size" value="10x10">
<label for="print_size">10x10 199:-</label>
<input id="print_size" type="radio" name="print_size" value="20x20">
<label for="print_size">20x20 299:-</label>
<input id="print_size" type="radio" name="print_size" value="40x40">
<label for="print_size">40x40 399:-</label>
<input id="print_size" type="radio" name="print_size" value="80x80">
<label for="print_size">80x80 599:-</label>
<!--CHECKBOX--->
<div>
<label>Additional features:</label>
<br>
<input id="feature1" type="checkbox" name="feature1" value="polished_glass">
<label for="feature1">Polished glass +100:-</label>
<br>
<input id="feature2" type="checkbox" name="feature2" value="3d_print">
<label for="feature2">3D-print +500:-</label>
</div>
<!--TEXTAREA--->
<div>
<label for="final_inputs">Additional input:</label>
<textarea id="final_inputs" name="final_inputs" rows="5" cols="20"></textarea>
</div>
<!--SUBMIT--->
<div>
<button type"submit" id="submit" value="submit">Submit order</button>
</div>
</form>
</main>
</body>
header, body {
color: black;
font-family: copperplate, sans-serif;
}
header {
text-align: center;
background-color: #C0C0C080;
margin: auto;
padding: 10px;
text-transform: uppercase;
}
body {
background-image: url("https://images.unsplash.com/photo-1504870712357-65ea720d6078?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1528&q=80");
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
#survey-form {
text-align: center;
color: dark-grey;
font-size: 12px;
padding: 10px;
width: 80%;
background-color: #C0C0C099;
margin: auto;
margin-top: 80px;
border-radius: 25px;
}
.selection {
margin-top: 1px;
margin-bottom: 15px;
}
label,input, select {
display: inline-block;
}
label {
width: 20%;
text-align: right;
background-color:red;
margin-right: 2px;
}
input {
width: 40%;
text-align: left;
background-color:blue;
margin-top: 2px;
}
header,
body {
color: black;
font-family: copperplate, sans-serif;
}
header {
text-align: center;
background-color: #C0C0C080;
margin: auto;
padding: 10px;
text-transform: uppercase;
}
body {
background-image: url("https://images.unsplash.com/photo-1504870712357-65ea720d6078?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1528&q=80");
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
#survey-form {
text-align: center;
color: dark-grey;
font-size: 12px;
padding: 10px;
width: 80%;
background-color: #C0C0C099;
margin: auto;
margin-top: 80px;
border-radius: 25px;
}
.selection {
margin-top: 1px;
margin-bottom: 15px;
}
label,
input,
select {
display: inline-block;
}
label {
width: 20%;
text-align: right;
background-color: red;
margin-right: 2px;
}
input {
width: 40%;
text-align: left;
background-color: blue;
margin-top: 2px;
}
<header>
<h1 id="title">Print selection</h1>
<p id="description">Tailor your prints</p>
</header>
<body>
<main>
<form id="survey-form">
<h2 class="selection">start your selection here</h2>
<label id="label-input" for="name">Name:</label>
<input class="input" id="name" type="text" name="name" placeholder="First Last" required>
<br>
<label id="email-input" for="email">E-mail:</label>
<input id="email" type="text" name="email" placeholder="first.last#gmail.com" required>
<br>
<label id="number-input" for="number">Age:</label>
<input id="number" type="number" name="number" min="18" max="99" required>
<br>
<label for="dropdown">Select frame:</label>
<select id="dropdown" name="frames">
<option value="gold frame">Gold</option>
<option value="metallic frame">Metallic</option>
<option value="wooden frame">Wooden</option>
</select>
<br>
<!--RADIO--->
<label>Size of print:</label>
<br>
<input id="print_size" type="radio" name="print_size" value="10x10">
<label for="print_size">10x10 199:-</label>
<input id="print_size" type="radio" name="print_size" value="20x20">
<label for="print_size">20x20 299:-</label>
<input id="print_size" type="radio" name="print_size" value="40x40">
<label for="print_size">40x40 399:-</label>
<input id="print_size" type="radio" name="print_size" value="80x80">
<label for="print_size">80x80 599:-</label>
<!--CHECKBOX--->
<div>
<label>Additional features:</label>
<br>
<input id="feature1" type="checkbox" name="feature1" value="polished_glass">
<label for="feature1">Polished glass +100:-</label>
<br>
<input id="feature2" type="checkbox" name="feature2" value="3d_print">
<label for="feature2">3D-print +500:-</label>
</div>
<!--TEXTAREA--->
<div>
<label for="final_inputs">Additional input:</label>
<textarea id="final_inputs" name="final_inputs" rows="5" cols="20"></textarea>
</div>
<!--SUBMIT--->
<div>
<button type "submit" id="submit" value="submit">Submit order</button>
</div>
</form>
</main>
</body>
Here's a simple starting point using CSS Grid
We are going to use two different grid layouts using the fieldset element and our grid container.
For simple Label | Input pairs the grid's first column will be the label taking 25% of the available space with the input occupying the rest.
For the radio button or check box groups, we will add a class to the fieldset then use three columns with 25% for the group label, auto for the input width, with the input label occupying the rest
fieldset {
border: none;
/*Set up base grid*/
display: grid;
/*Set Columns, first column is 25% the second takes up the rest*/
grid-template-columns: 25% 1fr;
row-gap: 0.5em;
}
/*Label styling*/
fieldset label {
text-align: right;
padding-right: 0.25em;
}
/*Additional set up for button group*/
fieldset.button-group {
/*For out button group rows we want the first col 25% ,
control minimum space, then next col take the rest*/
grid-template-columns: 25% auto 1fr;
}
/*Addditional stylings for the button/checkbox labels*/
fieldset.button-group label:not(:first-of-type) {
text-align: left;
}
/*Bump the buttons & check boxes to second column*/
fieldset.button-group input {
grid-column-start: 2;
}
<header>
<h1 id="title">Print selection</h1>
<p id="description">Tailor your prints</p>
</header>
<main>
<form id="survey-form">
<h2 class="selection">start your selection here</h2>
<fieldset>
<label id="label-input" for="name">Name:</label>
<input class="input" id="name" type="text" name="name" placeholder="First Last" required>
<label id="email-input" for="email">E-mail:</label>
<input id="email" type="text" name="email" placeholder="first.last#gmail.com" required>
<label id="number-input" for="number">Age:</label>
<input id="number" type="number" name="number" min="18" max="99" required>
<label for="dropdown">Select frame:</label>
<select id="dropdown" name="frames">
<option value="gold frame">Gold</option>
<option value="metallic frame">Metallic</option>
<option value="wooden frame">Wooden</option>
</select>
</fieldset>
<!--RADIO--->
<fieldset class="button-group">
<label>Size of print:</label>
<input id="print_size_199" type="radio" name="print_size" value="10x10">
<label for="print_size_199">10x10 199:-</label>
<input id="print_size_299" type="radio" name="print_size" value="20x20">
<label for="print_size_299">20x20 299:-</label>
<input id="print_size_399" type="radio" name="print_size" value="40x40">
<label for="print_size_399">40x40 399:-</label>
<input id="print_size_599" type="radio" name="print_size" value="80x80">
<label for="print_size_599">80x80 599:-</label>
</fieldset>
<!--CHECKBOX--->
<fieldset class="button-group">
<label>Additional features:</label>
<input id="feature1" type="checkbox" name="feature1" value="polished_glass">
<label for="feature1">Polished glass +100:-</label>
<input id="feature2" type="checkbox" name="feature2" value="3d_print">
<label for="feature2">3D-print +500:-</label>
</fieldset>
<!--TEXTAREA--->
<fieldset>
<label for="final_inputs">Additional input:</label>
<textarea id="final_inputs" name="final_inputs" rows="5" cols="20"></textarea>
</fieldset>
<!--SUBMIT--->
<div>
<button type "submit" id="submit" value="submit">Submit order</button>
</div>
</form>
</main>

Inputs & buttons remains centered inside a child div

I have a parent div with 3 child divs inside. I need that each child div take one third of the screen and that all elements (text, button and input) inside of each divs are responsive by always being to the center of the child divs.
I could make in sort that each child divs takes one third of the screen but the elements aren't responsive and are diving themselves in two columns inside the child divs, like seen in the picture below:
Here is the code used:
input,
select,
textarea {
width: 100%;
padding: 6px;
border: 1px solid #ccc;
border-radius: 5px;
}
label {
padding: 12px 12px 12px 0;
display: inline-block;
}
.Order_Create_Ship_Stock>div {
width: 30%;
margin: 5px;
padding: auto;
display: inline-table;
border: solid;
}
.Order_Create,
.Order_Ship,
.Order_Store {
border-radius: 5px;
background-color: #f2f2f2;
padding: 10px;
display: table-cell;
}
#SubmitCreateOrder,
#SubmitShipOrder,
#SubmitStoreOrder {
cursor: pointer;
display: flex;
flex-direction: column;
}
<div id="OrderCreateShipStock" class="Order_Create_Ship_Stock">
<div id="OrderCreate" class="Order_Create">
<form onsubmit="App.createOrder(); return false">
<label for="BarcodeInput">
<span>Barcode</span>
<input name="BarcodeInput"id="Barcode" class="Barcorde" type="text" placeholder="Order's Barcode...">
</label>
<label for="OwnerInput">
<span>Owner</span>
<input name="OwnerInput" id="Owner" class="Owner" type="text" placeholder="Owner of the product...">
</label>
<label for="ProductListInput">
<span>Product list</span>
<input name="ProductListInput" id="ProductList" class="Product_List" type="text" placeholder="Product list of the order....">
</label>
<label for="ExpirationDateInput">
<span>Expiration date</span>
<input name="ExpirationDateInput" id="ExpirationDate" class="Expiration_Date" type="date">
</label>
<label for="TemperatureMinimalInput">
<span>Temperature minimal</span>
<input name="TemperatureMinimalInput" id="TemperatureMinimal" class="Temperature_Minimal" type="number" placeholder="Minimal temperature of order's environment...">
</label>
<label for="TemperatureMaximalInput">
<span>Temperature maximal</span>
<input name="TemperatureMaximalInput" id="TemperatureMaximal" class="Temperature_Maximal" type="number" placeholder="Maximal temperature of order's environment...">
</label>
<label for="IOTDeviceInput">
<span>IOT Device</span>
<select name="IOTDeviceInput" id="IOTDevice" class="IOT_Device">
<option value="">---Please select an IOT Device---</option>
</select>
</label>
<label for="FinalDestinationInput">
<span>Final destination</span>
<input name="FinalDestinationInput" id="FinalDestination" class="Final_Destination" type="text" placeholder="Order's final destination...">
</label>
<button id="SubmitCreateOrder" class="Submit_Create_Order" type="submit">Create Order</button>
</form>
</div>
<div id="OrderShip" class="Order_Ship">
<form onsubmit="App.ShipOrder(); return false">
<label for="OrderIDInput">
<span>OrderID</span>
<input name="OrderIDInput" id="OrderID" class="Order_ID" type="text" placeholder="Order's ID">
</label>
<label for="ActualLocationInput">
<span>Actual location</span>
<input name="ActualLocationInput" id="ActualLocation" class="Actual_Location_Input" type="text" placeholder="Order's actual location">
</label>
<label for="ActualTemperatureInput">
<span>Actual temperature</span>
<input name="ActualTemperatureInput" id="ActualTemperature" class="Actual_Temperature" type="text" placeholder="Order's actual environment temperature">
</label>
<label for="CurrentCounterpartyInput">
<span>Counterparty</span>
<input name="CurrentCounterpartyInput" id="CurrentCounterparty" class="Current_Counterparty" type="text" placeholder="Order's current counterparty">
</label>
<label for="IOTDeviceInput">
<span>IOT Device</span>
<select name="IOTDeviceInput" id="IOTDevice" class="IOT_Device_Input">
</select>
</label>
<label for="AnticipatedDateInput">
<span>Anticipated date</span>
<input name="AnticipatedDateInput" id="AnticipatedDate" class="Anticipated_Date" type="date">
</label>
<label for="DestinationInput">
<span>Destination</span>
<input name="DestinationInput" id="Destination" class="Destination_" type="text" placeholder="Order's destination">
</label>
<button id="SubmitShipOrder" class="Submit_Ship_Order" type="submit">Ship Order</button>
</form>
</div>
<div id="OrderStore" class="Order_Store">
<form onsubmit="App.storeOrder(); return false">
<label for="OrderIDInput">
<span>OrderID</span>
<input name="OrderIDInput" id="OrderID" class="Order_ID" type="text" placeholder="Order's ID">
</label>
<label for="ActualLocationInput">
<span>Actual location</span>
<input name="ActualLocationInput" id="ActualLocation" class="Actual_Location_Input" type="text" placeholder="Order's actual location">
</label>
<label for="ActualTemperatureInput">
<span>Actual temperature</span>
<input name="ActualTemperatureInput" id="ActualTemperature" class="Actual_Temperature" type="text" placeholder="Order's actual environment temperature">
</label>
<label for="CurrentCounterpartyInput">
<span>Counterparty</span>
<input name="CurrentCounterpartyInput" id="CurrentCounterparty" class="Current_Counterparty" type="text" placeholder="Order's current counterparty">
</label>
<label for="IOTDeviceInput">
<span>IOT Device</span>
<select name="IOTDeviceInput" id="IOTDevice" class="IOT_Device_Input">
<option value="">---Please select an IOT Device---</option>
</select>
</label>
<button id="SubmitStoreOrder" class="Submit_Store_Order" type="submit">Store Order</button>
</form>
</div>
</div>
While I was working I could somehow make in sort that the buttons remains in one column by using flexbox (flex-direction: column), but this method didn't work for the inputs and textarea...
So I would like to ask some help to make in sort that all elements inside these child divs remain in only one column please.
I thank in advance anybody who will take the time to help me.
For the buttons, adding margin: auto, centered any child will do the job and I add one more option to the first Button if you find useful to make it a full button.
Also for the container to be responsive, you can to set the parent the flex box. Then set all child with flex: 1 and use media queries to make it columns.
/* --- FOR THE CONTAINERS --- */
#OrderCreateShipStock {
display: flex;
}
.Order_Create_Ship_Stock>div {
margin: 5px;
border: solid;
flex: 1;
}
#media only screen and (max-width: 800px) {
#OrderCreateShipStock {
flex-wrap: wrap;
flex-direction: column;
}
}
/* --- BUTTON CENTERED --- */
#SubmitCreateOrder, #SubmitShipOrder, #SubmitStoreOrder {
display: flex;
margin: auto;
}
/* --- BUTTON FULL CENTERED TEXT --- */
#SubmitCreateOrder, #SubmitShipOrder, #SubmitStoreOrder {
width: 100%;
justify-content: center;
align-items: center;
}
input,
select,
textarea {
width: 100%;
padding: 6px;
border: 1px solid #ccc;
border-radius: 5px;
}
label {
padding: 12px 12px 12px 0;
display: inline-block;
}
#OrderCreateShipStock {
display: flex;
}
.Order_Create_Ship_Stock>div {
margin: 5px;
border: solid;
flex: 1;
}
.Order_Create,
.Order_Ship,
.Order_Store {
border-radius: 5px;
background-color: #f2f2f2;
padding: 10px;
display: table-cell;
}
#SubmitCreateOrder,
#SubmitShipOrder,
#SubmitStoreOrder {
display: flex;
margin: auto;
}
#SubmitCreateOrder {
width: 100%;
justify-content: center;
align-items: center;
}
#media only screen and (max-width: 500px) {
#OrderCreateShipStock {
flex-wrap: wrap;
flex-direction: column;
}
}
<div id="OrderCreateShipStock" class="Order_Create_Ship_Stock">
<div id="OrderCreate" class="Order_Create">
<form onsubmit="App.createOrder(); return false">
<label for="BarcodeInput">
<span>Barcode</span>
<input name="BarcodeInput"id="Barcode" class="Barcorde" type="text" placeholder="Order's Barcode...">
</label>
<label for="OwnerInput">
<span>Owner</span>
<input name="OwnerInput" id="Owner" class="Owner" type="text" placeholder="Owner of the product...">
</label>
<label for="ProductListInput">
<span>Product list</span>
<input name="ProductListInput" id="ProductList" class="Product_List" type="text" placeholder="Product list of the order....">
</label>
<label for="ExpirationDateInput">
<span>Expiration date</span>
<input name="ExpirationDateInput" id="ExpirationDate" class="Expiration_Date" type="date">
</label>
<label for="TemperatureMinimalInput">
<span>Temperature minimal</span>
<input name="TemperatureMinimalInput" id="TemperatureMinimal" class="Temperature_Minimal" type="number" placeholder="Minimal temperature of order's environment...">
</label>
<label for="TemperatureMaximalInput">
<span>Temperature maximal</span>
<input name="TemperatureMaximalInput" id="TemperatureMaximal" class="Temperature_Maximal" type="number" placeholder="Maximal temperature of order's environment...">
</label>
<label for="IOTDeviceInput">
<span>IOT Device</span>
<select name="IOTDeviceInput" id="IOTDevice" class="IOT_Device">
<option value="">---Please select an IOT Device---</option>
</select>
</label>
<label for="FinalDestinationInput">
<span>Final destination</span>
<input name="FinalDestinationInput" id="FinalDestination" class="Final_Destination" type="text" placeholder="Order's final destination...">
</label>
<button id="SubmitCreateOrder" class="Submit_Create_Order" type="submit">Create Order</button>
</form>
</div>
<div id="OrderShip" class="Order_Ship">
<form onsubmit="App.ShipOrder(); return false">
<label for="OrderIDInput">
<span>OrderID</span>
<input name="OrderIDInput" id="OrderID" class="Order_ID" type="text" placeholder="Order's ID">
</label>
<label for="ActualLocationInput">
<span>Actual location</span>
<input name="ActualLocationInput" id="ActualLocation" class="Actual_Location_Input" type="text" placeholder="Order's actual location">
</label>
<label for="ActualTemperatureInput">
<span>Actual temperature</span>
<input name="ActualTemperatureInput" id="ActualTemperature" class="Actual_Temperature" type="text" placeholder="Order's actual environment temperature">
</label>
<label for="CurrentCounterpartyInput">
<span>Counterparty</span>
<input name="CurrentCounterpartyInput" id="CurrentCounterparty" class="Current_Counterparty" type="text" placeholder="Order's current counterparty">
</label>
<label for="IOTDeviceInput">
<span>IOT Device</span>
<select name="IOTDeviceInput" id="IOTDevice" class="IOT_Device_Input">
</select>
</label>
<label for="AnticipatedDateInput">
<span>Anticipated date</span>
<input name="AnticipatedDateInput" id="AnticipatedDate" class="Anticipated_Date" type="date">
</label>
<label for="DestinationInput">
<span>Destination</span>
<input name="DestinationInput" id="Destination" class="Destination_" type="text" placeholder="Order's destination">
</label>
<button id="SubmitShipOrder" class="Submit_Ship_Order" type="submit">Ship Order</button>
</form>
</div>
<div id="OrderStore" class="Order_Store">
<form onsubmit="App.storeOrder(); return false">
<label for="OrderIDInput">
<span>OrderID</span>
<input name="OrderIDInput" id="OrderID" class="Order_ID" type="text" placeholder="Order's ID">
</label>
<label for="ActualLocationInput">
<span>Actual location</span>
<input name="ActualLocationInput" id="ActualLocation" class="Actual_Location_Input" type="text" placeholder="Order's actual location">
</label>
<label for="ActualTemperatureInput">
<span>Actual temperature</span>
<input name="ActualTemperatureInput" id="ActualTemperature" class="Actual_Temperature" type="text" placeholder="Order's actual environment temperature">
</label>
<label for="CurrentCounterpartyInput">
<span>Counterparty</span>
<input name="CurrentCounterpartyInput" id="CurrentCounterparty" class="Current_Counterparty" type="text" placeholder="Order's current counterparty">
</label>
<label for="IOTDeviceInput">
<span>IOT Device</span>
<select name="IOTDeviceInput" id="IOTDevice" class="IOT_Device_Input">
<option value="">---Please select an IOT Device---</option>
</select>
</label>
<button id="SubmitStoreOrder" class="Submit_Store_Order" type="submit">Store Order</button>
</form>
</div>
</div>
Just found the error, I just needed to add to label and not input, select the following:
display: flex;
flex-direction: column;

Html CSS form changing background

Im making this webpage and I am almost done its just I have a question regarding the background because the second one is the one that its supposed to look like and the first one is mine. I just want to get rid of that white space in between and have like outer padding. Ive tried playing around with padding and it didnt work for some reason heres the link (https://imgur.com/a/FlVN538) also heres my code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Cycling Tours</title>
<style>
body {
font-family: Verdana, sans-serif;
}
form {
width: 700px;
margin: 0 auto;
}
h1 {
text-align: center;
}
fieldset {
background-color: #4681A4;
min-width: 700px;
max-width: 700px;
border: solid white 2px;
}
legend {
color: white;
text-indent: 2em;
}
label {
font-size: 0.9em;
}
textarea {
display: block;
width: 80%;
height: 100px;
min-width: 50%;
max-width: 90%;
}
.buttonstyle {
text-transform: uppercase;
font-weight: bold;
background-color:#FFFFE6;
}
input[type=text], input[type=email], input[type=phonenumber] {
background-color:#ffffe6;
}
</style>
</head>
<body>
<h1>Fall 2018 Reviews</h1>
<form method="POST" action="https://csunix.mohawkcollege.ca/tooltime/showit.pl">
<!--<input type="hidden" name="formname" value="Donation Form">
<input type="hidden" name="windowname" value="Donation">-->
<fieldset id="aboutyou">
<legend>About you(optional)</legend>
<label for="aboutyou">I usually prefer to trips around this time of year(select all that apply)</label>
<br>
<select name="seasons" id="seasons" size="4" multiple>
<option>Winter</option>
<option>Spring</option>
<option>Summer</option>
<option>Fall</option>
</select>
<br>
<label for="firstname">First Name</label>
<input type="text" name="firstname" id="firstname" >
<br>
<label for="lastname">Last Name</label>
<input type="text" name="lastname" id="lastname">
<br>
<label for="phonenumber">Phone Number</label>
<input type="phonenumber" name="phonenumber" id="phonenumber" placeholder="123-456-7890" size="12">
<br>
<label for="email">Email Address</label>
<input type="email" name="email" id="email" placeholder="name#example.com" size="40">
</fieldset>
<fieldset>
<legend>Trip Reviews</legend>
<div id="trails">
<label for="trailchoice"></label>
<select name="trailchoice" id="trailchoice">
<option value="Alberta Rural">Alberta Rural</option>
<option value="B.C. Coast">B.C. Coast</option>
<option value="Ontario Lake Superior">Ontario Lake Superior</option>
<option value="PEI">PEI</option>
<option value="Nova Scotia Cabot Trail">Nova Scotia Cabot Trail</option>
</select>
<div id="daylength">
<label for="days"></label>
<select name="days" id="days">
<option value="5 days">5 days</option>
<option value="7 days">7 days</option>
<option value="10 days">10 days</option>
<option value="14 days">14 days</option>
</select>
<div id="credit">
<input type="radio" id="fourstars" value="4" checked>
<label for="fourstars"><img src="l5mg/wheel_sm.jpg"><img src="l5mg/wheel_sm.jpg"><img src="l5mg/wheel_sm.jpg"><img src="l5mg/wheel_sm.jpg"></label>
<br>
<input type="radio" name="threestars" id="threestars" value="3">
<label for="threestarts"><img src="l5mg/wheel_sm.jpg"><img src="l5mg/wheel_sm.jpg"><img src="l5mg/wheel_sm.jpg"></label>
<br>
<input type="radio" name="twostars" id="twostars" value="2">
<label for="twostars"><img src="l5mg/wheel_sm.jpg"><img src="l5mg/wheel_sm.jpg"></label>
<br>
<input type="radio" name="onestar" id="onestar" value="1">
<label for="onestar"><img src="l5mg/wheel_sm.jpg"></label>
<br>
<label for="feedback">comments</label>
<textarea name="feedback" id="feedback" rows="6" cols="45" placeholder="Place feedback here..."></textarea>
</div>
</select>
</div>
</fieldset>
<fieldset id="fsfeedback">
<legend>I would be interested in these trips:(check all that apply)</legend>
<input type="checkbox" name="Sea or Lake Coast" id="SLC" value="Sea or Lake coast">
<label for="SLC">Sea or lake coast</label>
<br>
<input type="checkbox" name="Rural" id="Rural" value="Rural">
<label for="Rural">Rural</label>
<br>
<input type="checkbox" name="Mountain" id="Mountain" value="Mountains">
<label for="Mountain">Mountains</label>
<br>
<input type="checkbox" name="other" id="other" value="other">
<label for="other" >Other (Please Specify)</label><label for="other"></label>
<input type="text" name="specified" id="specified">
</fieldset>
<input type="submit" value="Send Review" class="buttonstyle">
<input type="reset" value="Cancel" class="buttonstyle">
</form>
</body>
</html>
body {
font-family: Verdana, sans-serif;
}
form {
background: #4681A4;
width: 700px;
margin: 0 auto;
padding-top: 10px;
padding-bottom: 10px;
}
h1 {
text-align: center;
}
fieldset {
border: solid white 2px;
margin: 5px;
margin-bottom: 20px;
}
legend {
color: white;
text-indent: 2em;
}
label {
font-size: 0.9em;
}
textarea {
display: block;
width: 80%;
height: 100px;
min-width: 50%;
max-width: 90%;
}
.buttonstyle {
text-transform: uppercase;
font-weight: bold;
background-color: #FFFFE6;
}
input[type=text],
input[type=email],
input[type=phonenumber] {
background-color: #ffffe6;
}
.buttons {
margin-left: 19px;
}
<h1>Fall 2018 Reviews</h1>
<form method="POST" action="https://csunix.mohawkcollege.ca/tooltime/showit.pl">
<!--<input type="hidden" name="formname" value="Donation Form">
<input type="hidden" name="windowname" value="Donation">-->
<fieldset id="aboutyou">
<legend>About you(optional)</legend>
<label for="aboutyou">I usually prefer to trips around this time of year(select all that apply)</label>
<br>
<select name="seasons" id="seasons" size="4" multiple>
<option>Winter</option>
<option>Spring</option>
<option>Summer</option>
<option>Fall</option>
</select>
<br>
<label for="firstname">First Name</label>
<input type="text" name="firstname" id="firstname">
<br>
<label for="lastname">Last Name</label>
<input type="text" name="lastname" id="lastname">
<br>
<label for="phonenumber">Phone Number</label>
<input type="phonenumber" name="phonenumber" id="phonenumber" placeholder="123-456-7890" size="12">
<br>
<label for="email">Email Address</label>
<input type="email" name="email" id="email" placeholder="name#example.com" size="40">
</fieldset>
<fieldset>
<legend>Trip Reviews</legend>
<div id="trails">
<label for="trailchoice"></label>
<select name="trailchoice" id="trailchoice">
<option value="Alberta Rural">Alberta Rural</option>
<option value="B.C. Coast">B.C. Coast</option>
<option value="Ontario Lake Superior">Ontario Lake Superior</option>
<option value="PEI">PEI</option>
<option value="Nova Scotia Cabot Trail">Nova Scotia Cabot Trail</option>
</select>
<div id="daylength">
<label for="days"></label>
<select name="days" id="days">
<option value="5 days">5 days</option>
<option value="7 days">7 days</option>
<option value="10 days">10 days</option>
<option value="14 days">14 days</option>
</select>
<div id="credit">
<input type="radio" id="fourstars" value="4" checked>
<label for="fourstars"><img src="l5mg/wheel_sm.jpg"><img src="l5mg/wheel_sm.jpg"><img src="l5mg/wheel_sm.jpg"><img
src="l5mg/wheel_sm.jpg"></label>
<br>
<input type="radio" name="threestars" id="threestars" value="3">
<label for="threestarts"><img src="l5mg/wheel_sm.jpg"><img src="l5mg/wheel_sm.jpg"><img src="l5mg/wheel_sm.jpg"></label>
<br>
<input type="radio" name="twostars" id="twostars" value="2">
<label for="twostars"><img src="l5mg/wheel_sm.jpg"><img src="l5mg/wheel_sm.jpg"></label>
<br>
<input type="radio" name="onestar" id="onestar" value="1">
<label for="onestar"><img src="l5mg/wheel_sm.jpg"></label>
<br>
<label for="feedback">comments</label>
<textarea name="feedback" id="feedback" rows="6" cols="45" placeholder="Place feedback here..."></textarea>
</div>
</select>
</div>
</fieldset>
<fieldset id="fsfeedback">
<legend>I would be interested in these trips:(check all that apply)</legend>
<input type="checkbox" name="Sea or Lake Coast" id="SLC" value="Sea or Lake coast">
<label for="SLC">Sea or lake coast</label>
<br>
<input type="checkbox" name="Rural" id="Rural" value="Rural">
<label for="Rural">Rural</label>
<br>
<input type="checkbox" name="Mountain" id="Mountain" value="Mountains">
<label for="Mountain">Mountains</label>
<br>
<input type="checkbox" name="other" id="other" value="other">
<label for="other">Other (Please Specify)</label><label for="other"></label>
<input type="text" name="specified" id="specified">
</fieldset>
<div class="buttons">
<input type="submit" value="Send Review" class="buttonstyle">
<input type="reset" value="Cancel" class="buttonstyle">
</div>
</form>

Problems with html forms

My form views fine in IE7 and IE8 but FireFox does not display the form correctly: The problem is it does not display the form inside my "mainContent1"
Note my code below:
<div id="mainContent1">
<form action="forms.php" target="_self">
<fieldset>
<legend>Postal Address</legend>
<label for="street">Street address:</label>
<input id="street" name="street" type="text" />
<label for=" suburb">County</label>
<input id="county" name="county" type="text" />
<label for="state">State</label>
<input id="state" name="state" type="text" />
<label for="zip">Zip Code</label>
<input id="zip" name="zip" type="text" />
</fieldset>
</form>
</div>
fieldset {
float: left;
clear: both;
width: 100%;
margin: 0 0 -1em 0;
padding: 0 0 1em 0;
border-style: none;
border-top: 1px solid #BFBAB0;
background-color: #F2EFE9;
}
legend {
margin-left: 1em;
color: #000000;
font-weight: bold;
}
fieldset ol {
padding: 1em 1em 0 1em;
list-style: none;
}
fieldset li {
padding-bottom: 1em;
}
fieldset.submit {
border-style: none;
}
label em {
display: block;
color: #060;
font-size: 85%;
font-style: normal;
text-transform: uppercase;
}
Try putting a clearing div at the bottom, inside of #mainContent1...
<div id="mainContent1">
<form action="forms.php" target="_self">
<fieldset>
<legend>Postal Address</legend>
<label for="street">Street address:</label>
<input id="street" name="street" type="text" />
<label for=" suburb">County</label>
<input id="county" name="county" type="text" />
<label for="state">State</label>
<input id="state" name="state" type="text" />
<label for="zip">Zip Code</label>
<input id="zip" name="zip" type="text" />
</fieldset>
</form>
<div style="clear:both"></div>
</div>
Don't use a clearing div, it is cleaner to use the ".clearfix" method of clearing.
.clearfix:after{content:".";display:block;clear:both;height:0;visibility:hidden}
However, for IE you will need to add this to your IE css file:
.clearfix{zoom:1}
Then you simply add the class to the container element to clear the floats correctly.
<div id="mainContent1" class="clearfix">
<form action="forms.php" target="_self">
<fieldset>
<legend>Postal Address</legend>
<label for="street">Street address:</label>
<input id="street" name="street" type="text" />
<label for=" suburb">County</label>
<input id="county" name="county" type="text" />
<label for="state">State</label>
<input id="state" name="state" type="text" />
<label for="zip">Zip Code</label>
<input id="zip" name="zip" type="text" />
</fieldset>
</form>
</div>
This removes the need for extra empty elements within your HTML.