I have a menubar that looks like this:
What I want is that the dropdownbox aligns right of the label. The first one (#Writers) is correct, altough it should be aligned a little bit higher because now it isn't vertically centered but that's not the issue.
The HTML:
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/layout.css">
</head>
<body>
<div class="horizontalNavigation">
<ul>
<li><span>Issue</span></li>
<li><span>Series</span></li>
<li><span>Writer</span></li>
<li><span>Editor</span></li>
<li><span>Letterer</span></li>
<li><span>Colourist</span></li>
<li><span>Cover Artist</span></li>
<li><span>Inker</span></li>
<li><span>Penciler</span></li>
<li><span>Trade Paper Back</span></li>
<li><span>Publisher</span></li>
</ul>
</div>
<div class="creditsbar">
<div class="creditsbarfields">
<form action="getInfo.php" method="get">
<label class="creditsbardropdown" for="writerName">
<span>#Writers:</span>
<form action="">
<select name="writer">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>
</label>
<label class="creditsbardropdown" for="editorName">
<span>#Editors:</span>
<form action="">
<select name="editor">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>
</label>
<label class="creditsbardropdown" for="lettererName">
<span>#Letterer:</span>
<form action="">
<select name="letterer">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>
</label>
<label class="creditsbardropdown" for="colouristName">
<span>#Colourist:</span>
<form action="">
<select name="colourist">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>
</label>
<label class="creditsbardropdown" for="coverArtistName">
<span>#Cover Artist:</span>
<form action="">
<select name="coverArtist">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>
</label>
<label class="creditsbardropdown" for="inkerName">
<span>#Inker:</span>
<form action="">
<select name="inker">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>
</label>
<label class="creditsbardropdown" for="pencilerName">
<span>#Penciler:</span>
<form action="">
<select name="penciler">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>
</label>
<form>
<input type="submit" value="Next">
</form>
</form>
</div>
</div>
<div class="issueInformationLayout">
</div>
</body>
</html>
The CSS:
.creditsbar {
border: 5px solid;
border-radius: 25px;
width: 60%;
height: 5%;
margin: 1% 0% 0% 20%;
background-color: feedb4;
}
.creditsbarfields {
margin: 0% 0% 0% 2%;
width: 300%;
}
.creditsbardropdown {
float: left;
margin-right: 2%;
}
.horizontalNavigation {
background: url(../images/navigation.png) top left repeat-x;
border-radius: 75px;
height: 6%;
}
.horizontalNavigation * {
float: left;
}
.horizontalNavigation ul a {
margin: 5px 40px 0px 23px;
color: #578ba0;
font-size: 18px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
text-transform: uppercase;
}
.issueInformationLayout {
border: 5px solid;
border-radius: 25px;
border-color: #573700;
width: 50%;
height: 66%;
margin: 1% 0% 0% 25%;
background-color: feedb4;
overflow: hidden;
}
You have to set display:inline; for the dropdown lists:
HTML:
<div class="creditsbar">
<div class="creditsbarfields">
<form action="getInfo.php" method="get">
<label class="creditsbardropdown" for="writerName"> <span>#Writers:</span>
<form class="dropdownform" action="">
<select name="writer">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>
</label>
<label class="creditsbardropdown" for="editorName"> <span>#Editors:</span>
<form class="dropdownform" action="">
<select name="editor">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>
</label>
<label class="creditsbardropdown" for="lettererName"> <span>#Letterer:</span>
<form class="dropdownform" action="">
<select name="letterer">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>
</label>
<label class="creditsbardropdown" for="colouristName"> <span>#Colourist:</span>
<form class="dropdownform" action="">
<select name="colourist">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>
</label>
<label class="creditsbardropdown" for="coverArtistName"> <span>#Cover Artist:</span>
<form class="dropdownform" action="">
<select name="coverArtist">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>
</label>
<label class="creditsbardropdown" for="inkerName"> <span>#Inker:</span>
<form class="dropdownform" action="">
<select name="inker">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>
</label>
<label class="creditsbardropdown" for="pencilerName"> <span>#Penciler:</span>
<form class="dropdownform" action="">
<select name="penciler">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>
</label>
<form>
<input type="submit" value="Next" />
</form>
</form>
</div>
</div>
CSS:
.creditsbar {
border: 5px solid;
border-radius: 25px;
height: 5%;
}
.creditsbarfields {
margin: 0 0 0 2%;
width: 100%;
}
.creditsbardropdown {
float: left;
margin-right: 2%;
}
.dropdownform {
display:inline;
}
Take a look at the output of the code above Here
And here is a FIDDLE
You could give each span that contains a title a class and then do something like this: Code Pen
.title, select {float: left;}
Note: I didn't use your css because it looked like you are missing some stuff that breaks it.
Related
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>
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.
How can i add a border to a form i tried <border:2px;> but that does not work, I also tried adding a background image to the form but with no success i tried
.form-all {
background: url(url.jpg) no-repeat top left;
}
Here is my form
form {
border: 2px;
}
<form name="myform" id="EmailForm" action="" method="post">
<label> Number hours: </label>
<Select class="form-control input-sm error" min="3" name="Hours" id="Hours" onChange="calculatePrice()" placeholder="<?php echo $RoomErr;?>">
<OPTION value="0">Select Number of Hours</OPTION>
<OPTION value="45">3 Hours</OPTION>
<OPTION value="60">4 Hours</OPTION>
<OPTION value="75">5 hours</OPTION>
<OPTION value="90">5 hours +</OPTION>
</select>
<br>
<br>
<label>Would You Like Ironing? </label>
<Select NAME="ironing" id="ironing" onChange="calculatePrice()" class="form-control input-sm error" placeholder="<?php echo $ironingErr;?>">
<OPTION value="0">Would you Like Ironing?</OPTION>
<OPTION value="8">Yes</OPTION>
<OPTION value="0">No</OPTION>
</select>
<br><br> Your Estimated Quate: £<input class="transparent-input" type="text" id="PicExtPrice">
border:2px solid #000;
Or, you can replace #000 with any colour you like.
<div style="width: 100%; overflow: hidden;">
<div style="margin-left: 100px; width: 600px; float: left;">
<div class="description">
<h2 style="color:blue">Select the appropriate version</h2>
</div>
<select>
<option value="" disabled selected>Select version</option>
<option value="" disabled selected>Select feature</option>
<option value="A"> A </option>
<option value="B"> B </option>
<option value="C"> C</option>
</select>
<div style=" margin-left: 350px; width: 600px; float: left;">
<div class="description">
<h2 style="color:blue">Select the appropriate category</h2>
</div>
<select>
<option value="" disabled selected>Select feature</option>
<option value="" disabled selected>Select category</option>
<option value="A"> A </option>
<option value="B"> B </option>
<option value="C"> C</option>
</select>
<div style="margin-left: 620px; width: 600px; float: left;">
<div class="description">
<br>
<h2 style="color:blue">Select the feature</h2>
</div>
<select>
<option value="" disabled selected>Select feature</option>
<option value="" disabled selected>Select category</option>
<option value="A"> A </option>
<option value="B"> B </option>
<option value="C"> C</option>
</select>
</div>
</div>
I want the three divs with the drop down lists to be next to each other horizontally. I have tried using float, inline and inline block. How can it be done in HTML.
Use inline-block and put properly your all divs.
Here is an example:
.selection {
display: inline-block;
}
h1{
display: inline-block;
font-size: 14px;
}
<div>
<div class="selection">
<h1>Select Option</h1>
<select>
<option>1</option>
<option>2</option>
<option>3</option>
</select>
</div>
<div class="selection">
<h1>Select Option</h1>
<select>
<option>1</option>
<option>2</option>
<option>3</option>
</select>
</div>
<div class="selection">
<h1>Select Option</h1>
<select>
<option>1</option>
<option>2</option>
<option>3</option>
</select>
</div>
</div>
<div style="float:left">
dropdown1
</div>
<div style="float:left">
dropdown2
</div>
<div style="float:left">
dropdown3
</div>
This will definitely work.
Problem in your code is over width. Better is you give width into % instead of px.
First of all, your code is really badly formatted.
Your are using 7 Div but you are missing 2 Div closing tags. Close the Div tags properly.
You are also fixing the width of all 3 divisions, so if the screen size is smaller than the combined width of the 3 div, your div's will no longer be displayed horizontally. Give width relative like width:30%.
Also remove margin from the elements. Use Padding instead to give space between div's.
<html>
<body>
<div style="width: 100%; overflow: hidden;">
<div style=" width: 33%;float: left;">
<div class="description">
<h2 style="color:blue">Select the appropriate version</h2>
</div>
<select>
<option value="" disabled selected>Select version</option>
<option value="" disabled selected>Select feature</option>
<option value="A"> A </option>
<option value="B"> B </option>
<option value="C"> C</option>
</select>
</div>
<div style="float: left;width: 33%;">
<div class="description">
<h2 style="color:blue">Select the appropriate category</h2>
</div>
<select>
<option value="" disabled selected>Select feature</option>
<option value="" disabled selected>Select category</option>
<option value="A"> A </option>
<option value="B"> B </option>
<option value="C"> C</option>
</select>
</div>
<div style=" float: left;width: 33%;">
<div class="description">
<br>
<h2 style="color:blue">Select the feature</h2>
</div>
<select>
<option value="" disabled selected>Select feature</option>
<option value="" disabled selected>Select category</option>
<option value="A"> A </option>
<option value="B"> B </option>
<option value="C"> C</option>
</select>
</div>
</div>
</body>
</html>
Problem is with your code you have 3 unclosed div tags and a lot of left margin plus try to use width and margin both in %
[Check pen] (http://codepen.io/anon/pen/gPzJpr)
for your html
<div class="container">
<div id="firstDiv">
<h1>Select the appropriate version</h1>
<select class="" name="">
<option value="" disabled selected>Select version</option>
<option value="" disabled selected>Select feature</option>
<option value="A"> A </option>
<option value="B"> B </option>
<option value="C"> C</option>
</select>
</div>
<div id="secondDiv">
<h1>Select the appropriate version</h1>
<select class="" name="">
<option value="" disabled selected>Select version</option>
<option value="" disabled selected>Select feature</option>
<option value="A"> A </option>
<option value="B"> B </option>
<option value="C"> C</option>
</select>
</div>
<div id="thirdDiv">
<h1>Select the appropriate version</h1>
<select class="" name="">
<option value="" disabled selected>Select version</option>
<option value="" disabled selected>Select feature</option>
<option value="A"> A </option>
<option value="B"> B </option>
<option value="C"> C</option>
</select>
</div>
</div>
for your css:
div{
display: inline-block;
position: relative;
margin: 5px;
padding: 15px;
}
#firstDiv{
background-color: #ccc;
}
#secondDiv{
background-color: #eee;
}
#thirdDiv{
background-color: #aaa;
}
Just like what #Maihan Nijat said, use external CSS to make it easier for you to debug.
I made a few changes to your code. The absolute easiest way to solve this problem is to ensure that the width of each element could fit next to each other on the screen. Not only does this require that the text is not too large, but also that the width you explicitly define does not overflow.
The simple solution to your problem is to place display: inline-block; on the elements which you would like side by side.
.left {
display: inline-block;
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
<div class="left">
<div class="description">
<h2 style="color:blue">Select the appropriate version</h2>
</div>
<select>
<option value="" disabled selected>Select version</option>
<option value="" disabled selected>Select feature</option>
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select>
</div>
<div class="left">
<div class="description">
<h2 style="color:blue">Select the appropriate category</h2>
</div>
<select>
<option value="" disabled selected>Select feature</option>
<option value="" disabled selected>Select category</option>
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select>
</div>
<div class="left">
<div class="description">
<br>
<h2 style="color:blue">Select the feature</h2>
</div>
<select>
<option value="" disabled selected>Select feature</option>
<option value="" disabled selected>Select category</option>
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select>
</div>
</body>
</html>
So I'm trying to be able to keep everything where it is even on a a window re size.. an example of what I wish for is similar to face book's registration page (or any page on facebook for that matter... everything gets hidden behind the browser as i minimize its width). I've included two links one a jfiddle and second an actual test page:
https://jsfiddle.net/0nskvmjc/
http://sushionfir3.byethost7.com/test/register.php
here's the html for my own registration page
<!--background image-->
<style type="text/css">
body {
background-image: url(bg/bg.jpg);
background-size: cover;
}
</style>
<!---->
<body>
<!--top green transparent bar-->
<nav class="bar"></nav>
<div class="logo">
<img src="img/logo.png" height=90px>
</div>
<br />
<div class="login">Log in</div>
<div class="signin">
<form class="pure-form" action="#" method="post">
<input class="input" type="text" placeholder="Email">
<input class="input" type="password" placeholder="Password">
<button type="submit" class="button-sign pure-button">Sign in</button>
</form>
<!---->
<!--registration form start-->
<div id="reg_border"></div>
<div class="reg_form">
<h2 id="register_right">Registration is free and easy!</h2>
<div class="form_inputs">
<form class="pure-form" action="#" method="POST">
<input class="input" type="text" name="firstname" placeholder="First name" />
<input class="input" type="text" name="lastname" placeholder="Last name" /><br />
<input class="input" type="email" name="email" placeholder="Email" size="49" /><br />
<div class="space">
<input class="input" type="text" name="remail" placeholder="Please re-enter your Email" size="49" /><br />
</div>
<div class="space">
<input class="input" type="password" name="npassword" placeholder="New password" size="49" />
</div>
<p class="birthdate">Date of birth</p>
<div class="birthday_options">
<select class="months">
<option value="jan">Jan</option>
<option value="feb">Feb</option>
<option value="mar">Mar</option>
<option value="apr">Apr</option>
<option value="may">May</option>
<option value="jun">Jun</option>
<option value="jul">Jul</option>
<option value="aug">Aug</option>
<option value="sep">Sep</option>
<option value="oct">Oct</option>
<option value="nov">Nov</option>
<option value="dec">Dec</option>
</select>
<select class="days">
<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>
<input class="input" type="text" name="year" placeholder="mm/dd/yyyy" size="10" />
</div><!--birthdaymonths-->
<p class="sex">Gender</p>
<div class="genders">
<input type="radio" name="gender" value="1">Male</input>
<input type="radio" name="gender" value="2">Female</input>
</div>
<button id="signup" type="submit" class="button-sign pure-button">Sign up!</button>
</form>
</div><!--form_inputs-->
</div><!--reg_form-->
</body>
and here's the css for it
.bar {
width: 100%;
height: 90px;
background-color: rgba(0,160,135,0.4);
}
.logo {
margin-top: -88px;
padding-left: 50px;
}
.login {
text-align: right;
margin-top: -100px;
margin-right: 486px;
color: white;
}
.signin {
text-align: right;
padding-right: 50px;
padding-top: 5px
}
#reg_border {
background: rgba(0,160,135,0.4);
width: 32%;
height: 70%;
margin: 6% 1% 3% auto;
-webkit-border-radius: 70px;
-moz-border-radius: 70px;
-o-border-radius: 70px;
}
.reg_form {
text-align: right;
padding-right: 24px;
line-height: 48px;
margin-top: -525px;
}
.input {
line-height: 20px
}
#register_right {
padding-right: 29px;
padding-top: 30px
}
.birthdate {
margin: auto 310px auto 100px;
}
.birthday_options {
margin: -10px 125px auto 100px;
}
.sex {
margin: -5px 345px auto 100px;
}
.genders {
margin: -20px 265px auto auto;
}
.space {
margin-top: 4px
}
#signup {
width: 13em;
margin: 2px 95px auto auto
}
Thank you in advance. I've tried looking up these questions but none of the answers on other people's questions seem to work for me.. maybe the issue is within what I've already coded and adding extra bits of code isn't going to help or MAYBE it is, I'm not sure haha. Thank you again.
I GOT IT! For me, adding a min and max width of 1366px did the trick!
<style type="text/css">
body, html {
background-image: url(bg/bg.jpg);
background-size: cover;
width: 100%;
height: 100%;
min-width: 1366px;
margin: auto auto;
max-width: 1366px;
}
</style>
I'm somewhat satisfied with its current result, however, still open for a better way :)