Mail Chimp Custom Form - css

I am new to this, I am trying to create a custom mail chimp sign up form.
I want it to look like this http://imgur.com/YbwSzA2
I have started coding the form
#mce-FNAME {
margin: 10px;
float: left;
width: 50%;
}
#mce-LNAME {
margin: 10px;
float: left;
width: 50%;
}
#mce-email {
float: left;
margin: 10px;
width: 80%;
}
#mc_embed_signup .button {
width:20%;
float:left;
}
<!-- Begin MailChimp Signup Form -->
<div id="mc_embed_signup">
<form action="//kayakinguk.us8.list-manage.com/subscribe/post?u=f3759cd613780ba95cc76028b&id=0f3ca35b8b" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<h2>Subscribe to our newsletter</h2>
<div class="indicates-required"><span class="asterisk"></span></div>
<div class="mc-field-group">
<label for="mce-FNAME">First Name <span class="asterisk"></span>
</label>
<input type="text" value="" name="FNAME" class="required" id="mce-FNAME">
</div>
<div class="mc-field-group">
<label for="mce-LNAME">Last Name <span class="asterisk"></span>
</label>
<input type="text" value="" name="LNAME" class="required" id="mce-LNAME">
</div>
<div class="mc-field-group">
<label for="mce-EMAIL">Email Address <span class="asterisk"></span>
</label>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div> <!-- 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_f3759cd613780ba95cc76028b_0f3ca35b8b" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</div>
</form>
</div>
<!--End mc_embed_signup-->
If anyone has any suggestions or changes, that would be great.

Took the liberty to modify your code and selectors, if you have any questions, feel free to ask but it's pretty much self explanatory.
PS: Advice, use classes for styling css and reserve ID's for JavaScript
.input {
margin: 10px 0;
float: left;
width: 100%;
line-height: 25px;
border: 4px solid #000;
border-radius: 10px;
}
.input:focus,
.button:focus {
outline: none;
}
.button {
margin-top: 34px;
display: block;
width: 100%;
background: transparent;
border: 4px solid #000;
padding: 4px;
height: 35px;
font-size: 15px;
border-radius: 10px;
outline: none;
-webkit-transition: all 0.35s ease;
-moz-transition: all 0.35s ease;
-o-transition: all 0.35s ease;
transition: all 0.35s ease;
}
.button:hover {
cursor: pointer;
background: #000;
color: #fff;
}
.mc_embed_signup {
width: 100%;
max-width: 580px;
}
.mc-field-group label {
display: block;
font-size: 22px;
}
.row {
display: block;
float: left;
width: 100%;
}
.col-lg-6,
.col-lg-8,
.col-lg-4 {
float: left;
padding: 12px;
box-sizing: border-box;
}
.col-lg-6 {
width: 50%;
}
.col-lg-8 {
width: 80%;
}
.col-lg-4 {
width: 20%;
}
<div id="mc_embed_signup" class="mc_embed_signup">
<form action="//kayakinguk.us8.list-manage.com/subscribe/post?u=f3759cd613780ba95cc76028b&id=0f3ca35b8b" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<h2>Subscribe to our newsletter</h2>
<div class="row">
<div class="mc-field-group col-lg-6">
<label for="mce-FNAME">First Name:<span class="asterisk"></span></label>
<input type="text" value="" name="FNAME" class="input required" id="mce-FNAME">
</div>
<div class="mc-field-group col-lg-6">
<label for="mce-LNAME">Last Name:<span class="asterisk"></span></label>
<input type="text" value="" name="LNAME" class="input required" id="mce-LNAME">
</div>
</div><!--row-->
<div class="row">
<div class="mc-field-group col-lg-8">
<label class="label" for="mce-EMAIL">Email Address<span class="asterisk"></span></label>
<input type="email" value="" name="EMAIL" class="required input email" id="mce-EMAIL">
</div>
<div class="col-lg-4">
<input type="submit" value="Submit" name="subscribe" id="mc-embedded-subscribe" class="button">
</div>
</div><!--row-->
<div class="row" class="hidden">
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div>
<div style="position: absolute; left: -5000px;">
<input type="text" name="b_f3759cd613780ba95cc76028b_0f3ca35b8b" tabindex="-1" value="">
</div>
</div><!--row-->
</div><!--mc_embed_signup_scroll-->
</form>
</div><!--mc_embed_signup-->
Result:
Good Luck,
Michel

Related

How to fix this form fields to be perfect?

I want this form fields just like the red line in this picture https://i.stack.imgur.com/gbvDs.png
input,
select,
textarea {
width: 20%;
padding: 12px;
border: 1px solid #ccc;
box-sizing: border-box;
margin-left: 20px;
}
label {
padding: 12px 12px 12px 0;
display: inline-block;
}
.container {
/* the form is inside this container */
padding: 20px;
margin: 20px;
overflow: auto;
text-align: center;
}
<div class="container">
<form method="post" enctype="multipart/form-data" id="form">
<label for="id_image1">profile picture</label>
<input type="file" name="image1" accept="image/*" required id="id_image1" />
<label for="id_image2">cover picture</label>
<input type="file" name="image2" accept="image/*" required id="id_image2" />
<label for="id_tag">Name:</label> <input type="text" name="tag" maxlength="50" required id="id_tag" />
<button type="submit" class="button">Upload</button>
</form>
</div>
You can accomplish this with CSS Grid and a little padding.
.wrap,
.field-container {
display: inline-grid;
}
.field-container {
grid-template-columns: 1fr auto;
padding-bottom: 0.5rem;
}
.field-container label {
padding-right: 2rem;
text-align: right;
}
<div class="wrap">
<div class="field-container">
<label for="profilePic">Profile picture</label>
<input type="text" id="profilePic">
</div>
<div class="field-container">
<label for="coverPic">Cover picture</label>
<input type="text" id="coverPic">
</div>
<div class="field-container">
<label for="name">Name</label>
<input type="text" id="name">
</div>
</div>
jsFiddle
I changed your code this way, please check if it is suits what you desire:
<div class="container">
<form method="post" enctype="multipart/form-data" id="form">
<div class="rows">
<div class="column">
<label for="id_image1">profile picture</label>
<input type="file" name="image1" accept="image/*" required id="id_image1" />
</div>
<div class="column">
<label for="id_image2">cover picture</label>
<input type="file" name="image2" accept="image/*" required id="id_image2" />
</div>
<div class="column">
<label for="id_tag">Name:</label> <input type="text" name="tag" maxlength="50" required id="id_tag" />
<button type="submit" class="button">Upload</button>
</div>
</div>
</form>
</div>
<style>
input,
select,
textarea {
width: 55%;
padding: 12px;
border: 1px solid #ccc;
box-sizing: border-box;
margin-left: 20px;
}
label {
width:30%;
float:left;
}
#form{
width:100%;
}
.container {
width:40%;
margin:auto;
}
.rows{
width:100%;
display:block;
}
.column{
width:100%;
display:inline-block;
}
</style>

How to create bubble or infobox left side of input type text

I am trying to get that Password meter to the left side in the info box which a triangle tip..
.container {
width: 50%;
}
.infobox {
position: absolute;
}
<div class="container">
<input type ="text" placeholder="password">
<div class="infobox">
Password meter<br>
Uppercase<br>
Special Character<br>
</div>
</div>
You have work with css selector & css pseudo
.container {
width: 50%;
position: relative;
padding-left:240px;
}
.infobox {
position: absolute;
left: 0;
top: 0;
width: 200px;
height: 100px;
border: 1px solid #000;
background:#fff;
z-index: 1;
padding: 10px;
}
.infobox:after {
content: " ";
position: absolute;
right: -15px;
top: -1px;
border-top: 15px solid transparent;
border-right: none;
border-left: 15px solid black;
border-bottom: 15px solid transparent;
}
<div class="container">
<input type ="text" placeholder="password">
<div class="infobox">
<div class="arrow-right"></div>
Password meter<br>
Uppercase<br>
Special Character<br>
</div>
</div>
this what you are looking for!
you can check this codepen for better result.
.side-back{
height:100vh;
width:100%;
background:url("https://picsum.photos/1400") no-repeat center center;
background-size:cover;
}
.form-container{
width:100%;
height:100vh;
display:flex;
align-items:center;
justify-content:center;
}
.suggestion{
width:350px;
background-color:white;
top:-20px;
display:none;
left:-120%;
}
.bar {
height:7px;
}
input:focus + .suggestion{
display:block;
}
.suggestion:after, .suggestion:before {
left: 100%;
top: 20%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
}
.suggestion:after {
border-color: rgba(0, 0, 0, 0);
border-left-color: white;
border-width: 10px;
margin-top: -10px;
}
.suggestion:before {
border-color: rgba(108, 117, 125, 0);
border-left-color: #6c757d;
border-width: 11px;
margin-top: -11px;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row m-0">
<div class='col-12 p-0'>
<div class="form-container">
<form class="w-50">
<h1 class="mb-4">Sign In</h1>
<div class="form-group ">
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
</div>
<div class="form-group position-relative">
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
<div class="suggestion p-4 border border-secondary shadow-sm position-absolute">
<p class="mb-1"><b>Password strength:</b><span class="text-success">Good</span></p>
<div class="w-100 bg-light"><div class="w-75 bg-success bar"></div></div>
<p class="m-0 mt-1">Password must be at least 8 Characters! At least one Uppercase Character and one Special Character</p>
<div>
</div>
</div>
<div class="d-flex flex-wrap align-items-center justify-content-between">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1">
<label class="form-check-label" for="exampleCheck1">Remember me</label>
</div>
Forgot password?
</div>
<button type="submit" class="btn btn-primary w-100 mt-4">Sign In</button>
<p class="mt-2">no account? Sign Up</p>
</form>
</div>
</div>
</div>

Contact Form Div Is Overlapping Footer

I am making my own portfolio and want to add a contact form on it. But the div which contains the form is overlapping the footer in small screens. You can see the problem by running the code snippet. Could anyone please help me to solve this? It will be a great help. Thank you so much.
#contactus {
height: 105vh;
margin: 0 auto -80px;
position: relative;
z-index: 1;
}
#formContainer{ width: 85%; margin: 0 auto; background-color: aqua; }
.contactHead{ text-align: center}
.footer{
height:250px;
background-color:#1e1e1e;
text-align:center;
display:flex;
align-items:center;
justify-content:center;
}
.footer h2{
color: #fff;
}
<div id="contactus">
<div id="formContainer">
<h1 class="contactHead">Get In Touch!</h1>
<h4 class="contactHead">I will be with you within 24 hours</h4>
<form id="contactForm">
<input type="text" id="nameContainer" placeholder="Name">
<br>
<br>
<input type="email" id="emailContainer" placeholder="Email Address">
<br>
<br>
<input type="text" id="messageContainer" placeholder="Message">
<br>
<br>
<input type="submit" value="Send Message">
</form>
</div>
</div>
<div class="footer">
<h2>Footer</h2>
</div>
The negative margin and height is messing things up. What is the reason for having that height and the negative margin?
#contactus {
margin: 0 auto;
position: relative;
z-index: 1;
}
#formContainer {
width: 85%;
margin: 0 auto;
background-color: aqua;
}
.contactHead {
text-align: center
}
.footer {
height: 250px;
background-color: #1e1e1e;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
.footer h2 {
color: #fff;
}
<div id="contactus">
<div id="formContainer">
<h1 class="contactHead">Get In Touch!</h1>
<h4 class="contactHead">I will be with you within 24 hours</h4>
<form id="contactForm">
<input type="text" id="nameContainer" placeholder="Name">
<br>
<br>
<input type="email" id="emailContainer" placeholder="Email Address">
<br>
<br>
<input type="text" id="messageContainer" placeholder="Message">
<br>
<br>
<input type="submit" value="Send Message">
</form>
</div>
</div>
<div class="footer">
<h2>Footer</h2>
</div>

Bootstrap 4 removes CSS styling for small screens?

I have been out of the web development scene for a number of years and am getting back into it and developing a website using Bootstrap 4.
This maybe a stupid question but I have some CSS styling for checkboxes for some form elements and when reducing the screen size < 768px the styling vanishes...
Is this something fundamental to Bootstrap (although have not had this happen with any other CSS styled elements?) or am I doing something very obviously wrong?
Here are some code segments:
.question input {
position: absolute;
left: -9999px;
}
.question label {
display: block;
position: relative;
margin: 5px;
padding: 15px 30px 15px 55px;
border: 3px solid #fff;
border-radius: 20px;
color: #fff;
background-color: #005552;
white-space: pre-wrap;
cursor: pointer;
user-select: none;
transition: background-color .2s, box-shadow .2s;
}
.question label::before {
content: '';
display: block;
position: absolute;
top: 10px;
bottom: 10px;
left: 10px;
width: 32px;
border: 3px solid #fff;
border-radius: 20px;
transition: background-color .2s;
}
.question input:checked + label {
background-color: #ab576c;
}
.question input:checked + label::before {
background-color: #fff;
}
<form target="nextQuestion.php" action="post" style="margin-bottom: 0px;">
<input type="hidden" name="percentage" id="percentage">
<input type="hidden" name="currentQuestion" id="currentQuestion" value="1">
<div class="container-fluid">
<div class="row">
<div class="col-12 my-auto toxic-red-background" align="center">
<h6 class="white-text">Your Progress Through Our Questionnaire: </h6>
<div class="progress">
<div class="progress-bar-animated bg-primary" role="progressbar" style="width: 5%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-12 toxic-teal-background questionnaire-left-section question">
<h3>Q1: Would you use out website again?</h3>
<p> </p>
<input type="hidden" value="Question2">
<input id="yes" type="checkbox" class="QuestionnaureInput">
<label for="yes" class="QuestionnaireLabel">Yes</label>
<input id="no" type="checkbox" class="QuestionnaureInput">
<label for="no" class="QuestionnaireLabel">No</label>
<input id="maybe" type="checkbox" class="QuestionnaureInput">
<label for="maybe" class="QuestionnaireLabel">Maybe</label>
</div>
</div>
<div class="row">
<div class="col-sm-12 clearfix">
<button class="btn btn-primary mb-2 float-left">Prev</button>
<button type="submit" class="btn btn-primary mb-2 float-right">Next</button>
</div>
</div>
</div>
</form>
Here are some screen grabs to illustrate what is happening:
On larger screen - All OK
Screen resized to < 768px and styling is removed
Any suggestions, answers or guidance gratefully received as I am pulling my hair out!!
Thanks in Advance!

twitter bootstrap centered login form

im using twitter bootstrap 3 and trying to center login form.
Example is here http://jsfiddle.net/0y848kf8/.
form is like this
<div id="loginContainer" class="container">
<h2>Sign in</h2>
<form action="/www/sign/in" method="post" class="form-horizontal" id="frm-signInForm">
<div class="form-group"><label for="frm-signInForm-username" class=" control-label col-sm-2">Username:</label>
<div class="col-sm-5"><input type="text" name="username" id="frm-signInForm-username" required="" data-nette-rules="[{"op":":filled","msg":"Please enter your username."}]" value="" class="form-control"></div>
</div>
<div class="form-group"><label for="frm-signInForm-password" class=" control-label col-sm-2">Password:</label>
<div class="col-sm-5"><input type="password" name="password" id="frm-signInForm-password" required="" data-nette-rules="[{"op":":filled","msg":"Please enter your password."}]" class="form-control"></div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-5">
<input type="submit" name="send" id="frm-signInForm-send" value="Sign in" class="btn btn-default">
</div>
</div>
<div><input type="hidden" name="do" value="signInForm-submit"></div>
</form>
</div>
And im curious why pagination-center class not working on loginContainer and why form-groups have such big width. I thought that centering with bootstrap will be easy, but i must make some mistake.
Here is a basic use scenario to center the form using css media queries. You originally had div id="container-fluid" (you'll want class not id) which is a full-width container so you'll want div class="container" to utilize the bootstrap default css.
Let me know if this helps at all.
input[type="text"],
input[type="password"],
.form-control {
box-shadow: none;
padding: 4px 0px 0px 10px;
height: 40px;
width: 100%;
font-size: 16px;
color: #33342e;
border: 1px solid #1c1c1c;
border-radius: 1px;
line-height: 100%;
-webkit-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: none;
box-shadow: none;
-webkit-appearance: none;
appearance: none;
}
#contact-form {
padding: 15px 350px;
color: #1c1c1c;
font-size: 16px;
}
.btn-submit {
color: #fff;
background-color: #1c1c1c;
border-color: #fff;
width: 100%;
height: 45px;
font-size: 20px;
font-weight: 500;
margin: 5px 0px;
}
.btn-submit:hover {
color: #F00;
background-color: #FFF;
border: 2px solid #1c1c1c;
}
#media (max-width: 992px) {
#contact-form {
padding: 15px 50px;
}
}
#media (max-width: 480px) {
#contact-form {
padding: 15px 0px;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<form id="contact-form" name="contact-form" class="contact-form">
<fieldset>
<div class="row">
<div class="col-lg-12 form-group">
<h2>Sign In</h2>
<label for="user">Username</label>
<input class="form-control" type="text" value="" name="user" placeholder="Username" aria-required="true" />
</div>
<div class="col-lg-12 form-group">
<label for="Password">Password</label>
<input class="fom-control" type="text" value="" name="password" placeholder="Password" aria-required="true" />
</div>
<div class="col-lg-12 form-group">
<input type="submit" class="btn btn-submit" />
</div>
</div>
<!--end row-->
</fieldset>
</form>
</div>
Try this
http://jsfiddle.net/scaisEdge/bhk7n3ar/
<div id="loginContainer" class="container">
<h2 class="text-center">Sign in</h2>
and change width of the field

Resources