I am doing a vue project,but I want to create a form to log in and put an image behind the form.
I tried, but when I put the image behind the form, it did not appear on the page.
What should I do to add a picture behind the form?
Html:Here in this section I wrote HTML code.
<template>
<div>
<div class="signup-form">
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
<title>Bootstrap Simple Login Form with Blue Background</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<form action="/examples/actions/confirmation.php" method="post">
<h2>Sign Up</h2>
<p>Please fill in this form to create an account!</p>
<hr>
<div class="form-group">
<div class="row">
<div class="col-xs-6"><input type="text" class="form-control" name="first_name"
placeholder="First Name" required="required"></div>
<div class="col-xs-6"><input type="text" class="form-control" name="last_name"
placeholder="Last Name" required="required"></div>
</div>
</div>
<div class="form-group">
<input type="email" class="form-control" name="email" placeholder="Email"
required="required">
</div>
<div class="form-group">
<input type="password" class="form-control" name="password" placeholder="Password" `
required="required">`
</div>
<div class="form-group">
<input type="password" class="form-control" name="confirm_password" placeholder="Confirm
Password" required="required">
</div>
<div class="form-group">
<label class="checkbox-inline"><input type="checkbox" required="required"> I accept the
Terms of Use & Privacy Policy</label>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-lg">Sign Up</button>
</div>
</form>
<div class="hint-text">Already have an account? Login here</div>
</div> </div>
</template>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js">
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script>
export default {
data: {
counter: 0
}
};
</script>
Css:Here in this section i wrote Css Code.
<style scoped>
body {
color: #fff;
background: #3598dc;
font-family: 'Roboto', sans-serif;
}
.form-control{
height: 41px;
background: #f2f2f2;
box-shadow: none !important;
border: none;
}
.form-control:focus{
background: #e2e2e2;
}
.form-control, .btn{
border-radius: 3px;
}
.signup-form{
width: 390px;
margin: 30px auto;
}
.signup-form form{
color: #999;
border-radius: 3px;
margin-bottom: 15px;
background: #fff;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
padding: 30px;
}
.signup-form h2 {
color: #333;
font-weight: bold;
margin-top: 0;
}
.signup-form hr {
margin: 0 -30px 20px;
}
.signup-form .form-group{
margin-bottom: 20px;
}
.signup-form input[type="checkbox"]{
margin-top: 3px;
}
.signup-form .row div:first-child{
padding-right: 10px;
}
.signup-form .row div:last-child{
padding-left: 10px;
}
.signup-form .btn{
font-size: 16px;
font-weight: bold;
background: #3598dc;
border: none;
min-width: 140px;
}
.signup-form .btn:hover, .signup-form .btn:focus{
background: #2389cd !important;
outline: none;
}
.signup-form a{
color: #fff;
text-decoration: underline;
}
.signup-form a:hover{
text-decoration: none;
}
.signup-form form a{
color: #3598dc;
text-decoration: none;
}
.signup-form form a:hover{
text-decoration: underline;
}
.signup-form .hint-text {
padding-bottom: 15px;
text-align: center;
}</style>
You can use CSS' position property to stack an element on top of another. Here is an example.
/** GENERAL STYLES **/
* {
box-sizing: border-box;
}
form {
width: 300px;
margin: 1em auto;
border: 1px solid #eee;
}
form .form-group label,
form .form-group input {
width: 100%;
}
form h2 {
margin: 0 0 1em;
}
/** THE FIXES **/
.relative {
position: relative;
}
form .form-content {
padding: 1em;
position: relative;
}
form .behind-form {
position: absolute;
bottom: 0;
width: 100%;
}
form .behind-form img {
width: 100%;
display: block;
}
<form class="relative">
<div class="behind-form">
<img src="https://pixabay.com/get/52e8d3454e56a914f1dc8460da29317e173edce7545972_640.jpg" />
</div>
<div class="form-content">
<h2>Sign Up</h2>
<p>Please fill in this form to create an account!</p>
<div class="form-group">
<label>Name</label>
<input type="text" />
</div>
<div class="form-group">
<label>Email</label>
<input type="text" />
</div>
</div>
</form>
Related
I have a contact form that has a width of 45% of the parent div. Instead of white space next to it, I'd like to add a coloured div (a square grid) and add some relevant info within said coloured div. However, with my current code, I'm, unable to get the form and div inline.
I've read some SO posts this one, but they are unable to assist (maybe it's the way I have my current CSS code)
#contact {
width: 90%;
height: 700px;
margin-left: 5%;
background-color: #fff;
border-radius: 10px;
color: #000 !important;
margin: 0 auto;
clear: none;
}
#contact #header {
padding: 10px 0px;
width: 100%;
font-size: 36px;
float: left;
}
#contact-text {
font-size: 16px;
width: 45%;
}
textarea, input, #contact-text {
font-family: Quicksand;
font-size: 16px;
}
label {
display: block;
padding: 1rem 0 .5rem;
text-transform: uppercase;
font-size: 22px;
}
input, textarea {
display: block;
width: 45%;
border: 1px solid black;
padding: .5rem;
}
textarea {
height: auto;
resize: none;
}
button {
font-family: Quicksand;
font-size: 18px;
border: 1px solid black;
padding:.5rem;
width: auto;
text-transform: uppercase;
}
button:hover {
cursor: pointer;
}
#contact #grid {
height: 100%
width: 50%;
background-color: #bbc6cb;
float: right;
overflow: hidden;
display: inline;
}
<div id = "contact">
<div id = "header">
<h3>Contact.</h3>
</div>
<div id = "contact-text">
<p>Please fill out the quick form below and we will get in touch as soon as we can</p>
</div>
<form action="/" id="contact-form" method="post" role="form">
<div class = "label">
<label for="name" class="formText">Name:</label>
</div>
<input id="name" name="name" type="text" placeholder="Your name" required="required">
<div class = "label">
<label for="email" class="formText">Email:</label>
</div>
<input id="email" name="email" type="text" placeholder="Your email" required="required">
<div class = "label">
<label for="message" class="formText">Message:</label>
</div>
<textarea id="message" name="message" placeholder="Enter your message here" rows="10" required="required"></textarea>
<div>
<button type="submit">Send</button>
</div>
</form>
<div id = "grid">
</div>
</div>
Use this below code:
#contact {
height: 700px;
background-color: #fff;
border-radius: 10px;
color: #000 !important;
margin: 0 auto;
clear: none;
max-width: 1140px;
}
.left-gird, .right-grid {
width: 49%;
float: left;
}
.left-gird {
margin-right: 1%;
}
.right-gird {
margin-left: 1%;
}
.color-box {
height: 400px;
background-color: gray;
}
#contact #header {
padding: 10px 0px;
width: 100%;
font-size: 36px;
float: left;
}
#contact-text {
font-size: 16px;
width: 45%;
}
textarea, input, #contact-text {
font-family: Quicksand;
font-size: 16px;
}
label {
display: block;
padding: 1rem 0 .5rem;
text-transform: uppercase;
font-size: 22px;
}
input, textarea {
display: block;
width: 100%;
border: 1px solid black;
padding: .5rem;
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
textarea {
height: auto;
resize: none;
}
button {
font-family: Quicksand;
font-size: 18px;
border: 1px solid black;
padding:.5rem;
width: auto;
text-transform: uppercase;
}
button:hover {
cursor: pointer;
}
#contact #grid {
height: 100%;
width: 50%;
background-color: #bbc6cb;
float: right;
overflow: hidden;
display: inline;
}
h3 {
margin-top: 0;
}
<div id = "contact">
<div class="left-gird">
<div id = "header">
<h3>Contact.</h3>
</div>
<div id = "contact-text">
<p>Please fill out the quick form below and we will get in touch as soon as we can</p>
</div>
<form action="/" id="contact-form" method="post" role="form">
<div class = "label">
<label for="name" class="formText">Name:</label>
</div>
<input id="name" name="name" type="text" placeholder="Your name" required="required">
<div class = "label">
<label for="email" class="formText">Email:</label>
</div>
<input id="email" name="email" type="text" placeholder="Your email" required="required">
<div class = "label">
<label for="message" class="formText">Message:</label>
</div>
<textarea id="message" name="message" placeholder="Enter your message here" rows="10" required="required"></textarea>
<div>
<button type="submit">Send</button>
</div>
</form>
</div>
<div class="right-grid">
<div class="color-box"> color box here</div>
</div>
</div>
Use float:left for form and next div for inline
#contact {
width: 90%;
height: 700px;
margin-left: 5%;
background-color: #fff;
border-radius: 10px;
color: #000 !important;
margin: 0 auto;
clear: none;
}
#contact #header {
padding: 10px 0px;
width: 100%;
font-size: 36px;
float: left;
}
#contact-text {
font-size: 16px;
width: 45%;
}
textarea, input, #contact-text {
font-family: Quicksand;
font-size: 16px;
}
label {
display: block;
padding: 1rem 0 .5rem;
text-transform: uppercase;
font-size: 22px;
}
input, textarea {
display: block;
width: 90%;
border: 1px solid black;
padding: .5rem;
}
textarea {
height: auto;
resize: none;
}
button {
font-family: Quicksand;
font-size: 18px;
border: 1px solid black;
padding:.5rem;
width: auto;
text-transform: uppercase;
}
button:hover {
cursor: pointer;
}
form{
float:left;
width:50%;
}
#contact #grid {
height: 100%;
width: 50%;
background-color: #bbc6cb;
float: right;
overflow: hidden;
float:left;
}
<div id = "contact">
<div id = "header">
<h3>Contact.</h3>
</div>
<div id = "contact-text">
<p>Please fill out the quick form below and we will get in touch as soon as we can</p>
</div>
<form action="/" id="contact-form" method="post" role="form">
<div class = "label">
<label for="name" class="formText">Name:</label>
</div>
<input id="name" name="name" type="text" placeholder="Your name" required="required">
<div class = "label">
<label for="email" class="formText">Email:</label>
</div>
<input id="email" name="email" type="text" placeholder="Your email" required="required">
<div class = "label">
<label for="message" class="formText">Message:</label>
</div>
<textarea id="message" name="message" placeholder="Enter your message here" rows="10" required="required"></textarea>
<div>
<button type="submit">Send</button>
</div>
</form>
<div id = "grid">
</div>
</div>
This question already has answers here:
What is a clearfix?
(10 answers)
Closed 4 years ago.
I have some styling issues with my contact form and footer: I want a border-top at the top for the footer div to separate the contact form and footer. However, the border-top of the footer is pushed above the top of the contact form rather than the top of the footer
If I delete the contact form, the border-top is where it needs to be... I've attached an image (as the code snippet doesn't do my styling so far any justice)
#contact-text-title {
color: #5CDB95;
}
.left-grid, .right-grid {
width: 49%;
float: left;
margin-top: -2%;
}
.left-grid {
margin-right: 1%;
}
.right-grid {
margin-left: 1%;
}
#mobile-contact-content {
display: none;
}
form {
width: 98%;
}
textarea, input, #contact-text {
font-family: Quicksand;
font-size: 16px;
}
label {
display: block;
padding: 1rem 0 .5rem;
text-transform: uppercase;
font-size: 18px;
font-family: Karla;
}
input, textarea {
display: block;
width: 100%;
border: 1px solid black;
padding: .5rem;
font-family: Montserrat;
font-weight: 300;
}
textarea {
height: auto;
resize: none;
}
button {
font-family: Montserrat;
font-size: 18px;
border: 1px solid #379683;
padding:.5rem;
width: auto;
margin-top: 15px;
background-color: #379683;
color: #FFF;
}
button:hover {
cursor: pointer;
color: #379683;
border-color: #379683;
background-color: #FFF;
}
#contact-text {
display: table-cell;
text-align: center;
vertical-align: middle;
line-height: 48px;
height: 500px;
}
footer {
font-size: 12px !important;
height: 25px;
}
footer p {
border-top: 1px solid black;
}
footer .logo {
font-size: 18px !important;
border: 0px solid black;
text-align: left;
width: 50%;
float: left;
margin-bottom:30px;
}
footer #facebook {
font-size: 18px !important;
text-align: left;
width: 50%;
float: left;
margin-bottom:30px;
margin-top:17px;
color: #05386B;
}
footer #facebook:hover {
cursor: pointer;
}
<div class="col">
<div id="contact-block">
<div id="header">
<h4>Contact.</h4>
</div>
<div id="mobile-contact-content">
<p class="content-text">Do you have an idea for your garden or driveway?</p>
<p class="content-text"><span>We want to hear about it!</span></p>
<p class="content-text">Use the contact form to get in touch with us!</p>
</div>
<div class="left-grid">
<form action="/" id="contact-form" method="post" role="form">
<div class = "label">
<label for="name" class="formText">Name:</label>
</div>
<input id="name" name="name" type="text" placeholder="Your name" required="required">
<div class = "label">
<label for="email" class="formText">Email:</label>
</div>
<input id="email" name="email" type="text" placeholder="Your email" required="required">
<div class = "label">
<label for="message" class="formText">Message:</label>
</div>
<textarea id="message" name="message" placeholder="Enter your message here" rows="10" required="required"></textarea>
<div>
<button type="submit">Send</button>
</div>
</form>
</div>
<div class="right-grid" id="contact-box">
<div id="contact-text">
<p><span id="contact-text-title">Have a new project idea?</span>
<br>Use the contact form to tell us about it and we will get in touch with you</p>
</div>
</div>
</div>
</div>
<div class="col">
<footer>
<p><span class="logo" style="text-align:left;">Rob Moore LTD</span><span id="facebook" style="text-align:right;"><i class="fab fa-facebook-f fa-lg"></i></span>
</p>
</footer>
</div>
Set float:left to .col.
.col {
float: left;
}
And also add a width: 100%; to the last .col which contains the footer.
I am currently working on creating a sign up form html/css. I realised that different browsers work differently on the width of inputs. How can i rectify this issue and make sure that my sign up form is compatible with all browsers. My sign up form works perfectly for chrome as it is where i do coding on.
ul {
background-color: #000000;
}
li a:hover {
background-color: #0cf72a;
}
.word-container {
width: 500px;
height: 50px;
margin: auto;
position: relative;
top: 80px;
}
.word-container h1 {
margin: 0;
text-align: center;
color: #ab0a0a;
}
.register-container {
width: 600px;
height: 350px;
margin: auto;
position: relative;
top: 100px;
border: 1px solid #000;
}
.fname input[type="text"] {
position: relative;
left: 115px;
top: 30px;
padding: 8px;
}
.lname input[type="text"] {
position: relative;
left: 314px;
top: -5.5px;
padding: 8px;
}
.userid input[type="text"] {
position: relative;
left: 115px;
padding: 8px;
top: 10px;
}
.pwd input[type="password"] {
position: relative;
padding: 8px;
left: 115px;
top: 25px;
}
.email input[type="email"] {
position: relative;
padding: 8px;
left: 115px;
top: 40px;
}
.btn button[type="submit"] {
position: relative;
left: 115px;
top: 55px;
padding: 8px;
width: 382px;
border: 1px solid #000000;
color: #ffffff;
background-color: #ab0a0a;
}
div.btn button[type="submit"]:hover {
background-color: rgb(255, 0, 0);
}
<div class="word-container">
<h1>Create your account</h1>
</div>
<div class="register-container">
<form action="" method="POST">
<div class="fname">
<label>
<input type="text" placeholder="First Name" name="fname" size="20">
</label>
</div>
<div class="lname">
<label>
<input type="text" placeholder="Last Name" name="lname" size="20">
</label>
</div>
<div class="userid">
<label>
<input type="text" placeholder="Username" name="userid" size="50">
</label>
</div>
<div class="pwd">
<label>
<input type="password" placeholder="Password" name="pwd" size="50">
</label>
</div>
<div class="email">
<label>
<input type="email" placeholder="Email Address" name="email" size="50">
</label>
</div>
<div class="btn">
<button type="submit">Create Account</button>
</div>
</form>
</div>
It's always a good idea to use something like normalize.css or any other CSS reset code (eric meyer css reset is very popular too) to reset CSS across all browsers.
Any browser come with it's defaults values for padding's,margins,widths, heights etc...
I guess it won't be an 100% solution but it will defiantly will take you closer to what you're looking for.
Do not jump to position relative and absolute. If you are new to all this, I can understand it seems the most natural way to go about positioning elements; just using a top and left position and that's that. But this is not how you should do it on the web!
Below you can find how I would do it.
Matan G. is right in pointing out that a CSS reset/normalize is often used, and I do so myself as well. However, before you do that (and considering you're new) it would be wise to take a look at the code that I posted and see if it makes any sense to you. If not, ask.
It is important to note that you should avoid these things when possible:
setting a fixed width to text items such as headings, paragraphs, lists.
using relative/absolute positioning. They are very useful but only when necessary.
using too many divs/classes than actually needed. Don't overcrowd your HTML.
* {box-sizing: border-box;}
ul {
background-color: #000000;
}
li a:hover {
background-color: #0cf72a;
}
.word-container {
width: 500px;
height: 50px;
margin: 80px auto auto;
}
.word-container h1 {
margin: 0;
text-align: center;
color: #ab0a0a;
}
.register-container {
width: 600px;
margin: 20px auto auto;
border: 1px solid #000;
padding: 20px;
}
label {
display: block;
}
.name::after {
content: "";
display: table;
clear: both;
}
.name label:first-child {
margin-right: 20px;
}
.name label {
width: calc(100% / 2 - 10px);
float: left;
}
input, [type="submit"] {
padding: 8px;
margin-bottom: 20px;
width: 100%;
}
[type="submit"] {
border: 1px solid #000000;
color: #ffffff;
background-color: #ab0a0a;
margin: 0;
}
[type="submit"]:hover {
background-color: red;
}
<div class="word-container">
<h1>Create your account</h1>
</div>
<div class="register-container">
<form action="" method="POST">
<div class="name">
<label>
<input type="text" placeholder="First Name" name="fname">
</label>
<label>
<input type="text" placeholder="Last Name" name="lname">
</label>
</div>
<label>
<input type="text" placeholder="Username" name="userid">
</label>
<label>
<input type="password" placeholder="Password" name="pwd">
</label>
<label>
<input type="email" placeholder="Email Address" name="email">
</label>
<button type="submit">Create Account</button>
</form>
</div>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Forms</title>
<style>
.container{
width: 45%;
margin: auto;
}
.form-content{
margin: 40px;
}
.form-content input{
width: 100%;
}
label{
font-weight: bold;
}
input[type=text],[type=email],[type=tel],[type=date],[type=password]{
font-size: 16px;
border-radius: 5px;
background: #D9F1F7;
border: #000000;
padding: 10px;
}
input[type=submit]{
background: #4C63ED;
padding: 10px;
border: none;
border-radius: 5px;
font-size: 16px;
color: #fff;
cursor: pointer;
}
input[type=submit]:hover{
background: #330EEF;
font-weight: bold;
}
</style>
</head>
<body>
<div class = "container">
<form name="signup" method="get" action="">
<div class="form-content">
<label>First Name : </label>
<input type="text" name="firstname" />
</div>
<div class="form-content">
<label>Last Name : </label>
<input type="text" name="lastname" />
</div>
<div class="form-content">
<label>E-Mail : </label>
<input type="email" name="email" />
</div>
<div class="form-content">
<label>Telephone : </label>
<input type="tel" name="telephone" />
</div>
<div class="form-content">
<label>Date of Birth : </label>
<input type="date" name="dob" />
</div>
<div class="form-content">
<input type="submit" name="submit" value="Submit" />
</div>
</form>
</div>
</body>
</html>
I've found this q&a on stack but both solutions did not work..
How do I center a mailchimp embed form in a twitter bootstrap page?
centering input in form mailchimp
What I think these questions lack is both the code for the form and style code included (see below). How can I center both the content (text) and the div itself as a whole so it's responsively centered on the page?
<link href="//cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
<style type="text/css">
#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</style>
<center>
<div class="display:block margin:auto "id="mc_embed_signup">
<form action="//twitter.us11.list-manage.com/subscribe/post?u=b59cd34816a376a0c58945aee&id=2e74fec4e5" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<label for="mce-EMAIL">Subscribe to our mailing list</label>
<input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;"><input type="text" name="b_b59cd34816a376a0c58945aee_2e74fec4e5" tabindex="-1" value="">
</div>
<div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">
</div>
</div>
</div>
</form>
</div>
</center>
You can see I've attempted the tags as well as altering the class within the form..
Any help is greatly appreciated :3
First - remove center tags and this "class":
class="display:block margin:auto"
Second - you can set input width to 100% and block width to 58%:
#mc_embed_signup input.email {
...
width: 100%;
...
}
#mc_embed_signup form {
...
width: 58%;
margin: auto;
}
Example:
<link href="https://cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
<style type="text/css">
#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
#mc_embed_signup label {
text-align: center;
}
#mc_embed_signup input.email {
width: 100%;
}
#mc_embed_signup input.button {
margin: auto;
}
#mc_embed_signup form {
width: 58%;
margin: auto;
}
</style>
<div class="display:block margin:auto" id="mc_embed_signup">
<form action="//twitter.us11.list-manage.com/subscribe/post?u=b59cd34816a376a0c58945aee&id=2e74fec4e5" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<label for="mce-EMAIL">Subscribe to our mailing list</label>
<input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;">
<input type="text" name="b_b59cd34816a376a0c58945aee_2e74fec4e5" tabindex="-1" value="">
</div>
<div class="clear">
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">
</div>
</div>
</form>
</div>
Also, this looks like ugly hack:
style="position: absolute; left: -5000px;"
Why u don't use hidden input or "display: none"? :)
You are using bootstrap. So how about wrapping that code inside the bootstrap's grid system.
#mc_embed_signup {
background: #fff;
clear: left;
font: 14px Helvetica, Arial, sans-serif;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<div class="container-fluid">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<center>
<div class="display:block margin:auto " id="mc_embed_signup">
<form action="//twitter.us11.list-manage.com/subscribe/post?u=b59cd34816a376a0c58945aee&id=2e74fec4e5" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<label for="mce-EMAIL">Subscribe to our mailing list</label><br />
<input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;">
<input type="text" name="b_b59cd34816a376a0c58945aee_2e74fec4e5" tabindex="-1" value="">
</div>
<div class="clear">
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">
</div>
</div>
</form>
</div>
</center>
</div>
<div class="col-md-3"></div>
</div>
</div>
This article may help: Customize Your Own MailChimp E-Mail Newsletter Signup Form.
/** MailChimp Styles **/
#mc_embed_signup {
background: #fff;
clear: left;
font: 14px Helvetica, Arial, sans-serif;
text-align: center;
width: 350px;
margin: 0 auto;
}
/* MailChimp Form Embed Code - Slim - 08/17/2011 */
#mc_embed_signup form {
display: block;
position: relative;
text-align: center;
padding: 10px 0 10px 3%;
}
#mc_embed_signup h2 {
font-weight: bold;
padding: 0;
margin: 15px 0;
font-size: 1.4em;
}
#mc_embed_signup input {
border: 1px solid #ababab;
-webkit-appearance: none;
}
#mc_embed_signup input[type=checkbox] {
-webkit-appearance: checkbox;
}
#mc_embed_signup input[type=radio] {
-webkit-appearance: radio;
}
#mc_embed_signup input:focus {
border-color: #799877;
}
#mc_embed_signup .button {
display: block;
position: relative;
background-color: #266080;
padding: 0;
margin: 0 auto;
border: 0 none;
border-radius: 6px;
color: #fff;
cursor: pointer;
font-size: 14px;
width: 140px;
height: 36px;
line-height: 36px;
font-weight: bold;
text-align: center;
text-decoration: none;
vertical-align: top;
}
#mc_embed_signup .button:hover {
background-color: #f00;
}
#mc_embed_signup .button:active {
top: 2px;
border-bottom-width: 1px;
}
#mc_embed_signup .small-meta {
font-size: 11px;
}
#mc_embed_signup .nowrap {
white-space: nowrap;
}
#mc_embed_signup .clear {
clear: none;
display: inline;
}
#mc_embed_signup label {
display: block;
font-size: 13px;
text-transform: uppercase;
padding-bottom: 7px;
color: #616161;
font-weight: bold;
}
#mc_embed_signup input.email {
display: block;
padding: 8px 4px;
margin: 0 4% 10px 0;
text-indent: 5px;
color: #818181;
font-size: 1.0em;
background: #fff;
font-weight: bold;
width: 100%;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
transition: all 0.2s linear;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
#mc_embed_signup input.email:focus {
color: #666;
}
#mc_embed_signup div#mce-responses {
float: left;
top: -1.4em;
padding: 0em .5em 0em .5em;
overflow: hidden;
width: 90%;
margin: 0 5%;
clear: both;
}
#mc_embed_signup div.response {
margin: 1em 0;
padding: 1em .5em .5em 0;
font-weight: bold;
float: left;
top: -1.5em;
z-index: 1;
width: 80%;
}
#mc_embed_signup #mce-error-response {
display: none;
}
#mc_embed_signup #mce-success-response {
color: #529214;
display: none;
}
#mc_embed_signup label.error {
display: block;
float: none;
width: auto;
margin-left: 1.05em;
text-align: left;
padding: .5em 0;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div id="mc_embed_signup">
<form action="//twitter.us11.list-manage.com/subscribe/post?u=b59cd34816a376a0c58945aee&id=2e74fec4e5" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<label for="mce-EMAIL">Subscribe to our mailing list</label>
<input type="email" value="" name="EMAIL" class="email form-control" id="mce-EMAIL" placeholder="email address" required>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;">
<input type="text" name="b_b59cd34816a376a0c58945aee_2e74fec4e5" tabindex="-1" value="">
</div>
<div class="clear">
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">
</div>
</div>
</form>
</div>
</div>
I only got it to work when I changed your code in the CSS stylesheet to:
#mc_embed_signup {
border-radius: 12%;
margin: auto;
padding: 15px;
text-align: center;
width: 58%;
}
I require 2 text input boxes side by side in one page using css3. I have everything ready except that the second box is coming below the first input box. How can i correct this in css.
html:
<div class="main">
<div class="one">
<div class="register">
<h3>Create your account</h3>
<form id="reg-form">
<div>
<div>
<label for="username">Username</label>
<input type="text" id="username" spellcheck="false" placeholder="User Name" />
</div>
<div>
<label for="password">Password</label>
<input type="password" id="password" />
</div>
<div>
<label></label>
<input type="submit" value="Shop Login" id="create-account" class="button"/>
</div>
</form>
</div>
</div>
<div class="two">
<div class="register">
<h3>Create your account</h3>
<form id="reg-form1">
<div>
<label for="name1">Name</label>
<input type="text" id="name1" spellcheck="false" placeholder="Enter Your Name"/>
</div>
<div>
<label for="email1">Email</label>
<input type="text" id="email1" spellcheck="false" placeholder="mymail#mail.com"/>
</div>
<div>
<label for="username1">Username</label>
<input type="text" id="username1" spellcheck="false" placeholder="User Name" />
</div>
<div>
<label for="password1">Password</label>
<input type="password" id="password1" />
</div>
<div>
<label for="password-again1">Password Again</label>
<input type="password" id="password-again1" />
</div>
<div>
<label></label>
<input type="submit" value="Create Account" id="create-account1" class="button"/>
</div>
</form>
</div>
</div>
</div>
CSS
.main > div {
display: inline-block;
width: 49%;
margin-top: 10px;
}
.two .register {
border: none;
}
.two .register h3 {
border-bottom-color: #909090;
}
.two .register .sep {
border-color: #909090;
}
.register {
width: 400px;
margin: 10px auto;
padding: 10px;
border: 7px solid #ADD8E6;
border-radius: 10px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #444;
background-color: #f0f0f0;
box-shadow: 0 0 20px 0 #000000;
}
.register h3 {
margin: 0 15px 20px;
border-bottom: 2px solid #72b372;
padding: 5px 10px 5px 0;
font-size: 1.1em;
}
.register div {
margin: 0 0 15px 0;
border: none;
}
.register label {
display: inline-block;
width: 25%;
text-align: right;
margin: 10px;
}
.register input[type=text], .register input[type=password] {
width: 65%;
font-family: "Lucida Grande","Lucida Sans Unicode",Tahoma,Sans-Serif;
padding: 5px;
font-size: 0.9em;
border-radius: 5px;
background: rgba(0, 0, 0, 0.07);
}
.register input[type=text]:focus, .register input[type=password]:focus {
background: #FFFFFF;
}
.register .button {
font-size: 1em;
border-radius: 8px;
padding: 10px;
border: 1px solid #ADD8E6;
box-shadow: 0 1px 0 0 #05B8CC inset;
background: #05B8CC;
background: -webkit-linear-gradient(#ADD8E6, #05B8CC);
background: -moz-linear-gradient(#ADD8E6, #05B8CC);
background: -o-linear-gradient(#ADD8E6, #05B8CC);
background: linear-gradient(#ADD8E6, #05B8CC);
}
.register .button:hover {
background: #51db1c;
background: -webkit-linear-gradient(#51db1c, #6ba061);
background: -moz-linear-gradient(#51db1c, #6ba061);
background: -o-linear-gradient(#51db1c, #6ba061);
background: linear-gradient(#51db1c, #6ba061);
}
.register .sep {
border: 1px solid #72b372;
position: relative;
margin: 35px 20px;
}
.register .or {
position: absolute;
width: 50px;
left: 50%;
background: #f0f0f0;
text-align: center;
margin: -10px 0 0 -25px;
line-height: 20px;
}
.register .connect {
width: 400px;
margin: 0 auto;
text-align: center;
}
I have provided a jsFiddle Demo
I require it aligned side by side rather than top bottom as in demo. Thanks in advance
You have missed a closing div before <div class="two">.
Adding the closing div will make both forms next to each other.
Then you need to add a little CSS rule to make both forms perfectly aligned vertically:
div.one {
position: relative;
top: -165px
}
See the demo here: http://jsfiddle.net/t5SNE/7/