css rounded and background colour - css

can anyone help me achieve this looks?
I need that checkbox and form fields with round corners and background with that colour
thanks

Was this helpfull
.panel-default * {
background: #25A9DF !important;
color: #fff !important;
}
::-webkit-input-placeholder {
color: #fff!important;
}
:-moz-placeholder {
color: #fff;
opacity: 1!important;
}
::-moz-placeholder {
color: #fff;
opacity: 1!important;
}
:-ms-input-placeholder {
color: #fff!important;
}
.login-form .form-control {
padding: 0 12px;
height: auto;
font-size: 14px;
line-height: 3.428571;
}
.login-form .form-control,
.login-form .input-group-addon {
border: 1px solid #fff;
}
.login-form .form-control {
border-left: none;
}
.login-form .input-group-addon {
border-right: none;
}
.btn {
padding: 12px 12px!important;
border: 1px solid #fff!important;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://code.jquery.com/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<div class="container">
<div class="row">
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-body">
<form class="form-inline login-form">
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><i class="glyphicon glyphicon-user"></i>
</div>
<input type="text" class="form-control" id="exampleInputAmount" placeholder="Username or Email">
</div>
<div class="input-group">
<div class="input-group-addon"><i class="glyphicon glyphicon-lock"></i>
</div>
<input type="text" class="form-control" id="exampleInputAmount" placeholder="Password">
</div>
</div>
</form>
<div class="form-group text-right">
Forgot Password?
</div>
<div class="form-group">
<div class="btn btn-block btn-info">Login</div>
</div>
</div>
</div>
</div>
</div>
</div>

You'll need to use border-radius to curve the corners. If you're unsure use this tool (http://border-radius.com/) to help you achieve it.
I would go about this by making 2 input fields use border-radius to curve the top corners only for the first input and the bottom corners for the second. Then style the rest as appropriate.

Related

Align button to bottom of div in desktop and left of div in mobile

I am trying to align the button to the bottom of this div (so the bottom is flush with the bottom of textarea).
Codepen
I was able to do this by adding the following class to button:
.btn-bottom {
position: absolute;
top: 130px;
}
Unfortunately, doing so made the button disappear entirely on mobile:
How can I make the button align with the bottom of the textarea on desktop and with the left edge of the textarea on mobile?
<div class="padding">
<div class="container">
<div class="row">
<h3 class="text-center">Contact Us</h3>
<h5 class="text-center title-lighter">Our team will respond within 48 hours.</h5>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="col-md-4">
<label for="inputname">Name</label>
<input type="text" class="form-control" id="inputname">
</div>
<div class="col-md-4">
<label for="email">E-mail</label>
<input type="text" class="form-control" id="email">
</div>
<div class="col-md-4">
<label for="organization">Organization</label>
<input type="text" class="form-control" id="organization">
</div>
</div>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="col-md-8">
<label for="message">Message</label>
<textarea class="form-control input-lg" style="min-width: 100%;" rows="5" id="message"></textarea>
</div>
<div class="col-md-4">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</div>
<hr />
</div>
You could set the columns of the elements containing the textarea and the button to be display: inline-block (you would have to set float: none for this to work) and then use vertical-align: bottom to align the elements to the bottom of the line that they're siting on.
I also added a class of .row--mod to the row of the element containing the textarea and the button to help target the elements.
.row--mod .col-md-8.col-md-offset-2 > * {
float: none;
display: inline-block;
vertical-align: bottom;
}
.row--mod .col-md-8.col-md-offset-2> :first-child {
margin-right: -4px;
width: 66.6667%;
}
Using inline-block creates extra spacing which you can get rid using a number of methods (I've opted for a negative margin).
See below for a demo:
body {
font-size: 12px !important;
font-family: 'Roboto Condensed', sans-serif !important;
font-weight: 400 !important;
}
.title-lighter {
font-family: 'Roboto', Arial, Helvetica, sans-serif;
color: #737373;
}
.centering {
float: none;
margin: 0 auto;
}
.btn-centering {
width: 90% !important;
margin-left: 5% !important;
margin-bottom: 5px !important;
}
.padding {
padding: 80px 0;
}
.contact-form {
background: #fff;
margin-top: 10%;
margin-bottom: 5%;
width: 70%;
}
.contact-form .form-control {
border-radius: 1rem;
}
.contact-form form {
padding: 14%;
}
.contact-form form .row {
margin-bottom: -7%;
}
.contact-form h3 {
margin-bottom: 8%;
margin-top: -10%;
text-align: center;
color: #0062cc;
}
.contact-form .btnContact {
width: 50%;
border: none;
border-radius: 1rem;
padding: 1.5%;
background: #dc3545;
font-weight: 600;
color: #fff;
cursor: pointer;
}
.btnContactSubmit {
width: 50%;
border-radius: 1rem;
padding: 1.5%;
color: #fff;
background-color: #0062cc;
border: none;
cursor: pointer;
}
.centered-row {
text-align: center;
}
.btn-bottom {
display: table-cell;
vertical-align: bottom;
}
.box {
display: table !important;
width: 100%;
height: 100%;
}
#media (min-width: 992px)
{
.row--mod .col-md-8.col-md-offset-2 > * {
float: none;
display: inline-block;
vertical-align: bottom;
}
.row--mod .col-md-8.col-md-offset-2> :first-child {
margin-right: -4px;
width: 66.6667%;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="padding">
<div class="container">
<div class="row">
<h3 class="text-center">Contact Us</h3>
<h5 class="text-center title-lighter">Our team will respond within 48 hours.</h5>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="col-md-4">
<label for="inputname">Name</label>
<input type="text" class="form-control" id="inputname">
</div>
<div class="col-md-4">
<label for="email">E-mail</label>
<input type="text" class="form-control" id="email">
</div>
<div class="col-md-4">
<label for="organization">Organization</label>
<input type="text" class="form-control" id="organization">
</div>
</div>
</div>
<div class="row row--mod">
<div class="col-md-8 col-md-offset-2">
<div class="col-md-8">
<label for="message">Message</label>
<textarea class="form-control input-lg" style="min-width: 100%;" rows="5" id="message"></textarea>
</div>
<div class="col-md-4">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</div>
<hr />
</div>

Centering log in grid in my container?

I have tried different kinds of approach to center my log-in. I want it to be vertically and horizontally centered in my container. Would appreciate any help! Can someone give me some good idea?
<div class="container login">
<div class="col-md-4 login-centered">
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title"><strong style="color:white">Sign in </strong></h3></div>
<div class="panel-body">
<section role="form">
#using (Html.BeginForm()
{
#Html.AntiForgeryToken()
#Html.ValidationSummary()
<div class="form-group" style="display:block;margin:auto;">
<label>Username</label>
#Html.TextBoxFor()
#Html.ValidationMessageFor()
</div>
<div class="form-group" style="display:block;margin:auto;margin-top:6px;">
<label >Password</label>
#Html.PasswordFor()
#Html.ValidationMessageFor( )
</div>
<input type="submit" value="Log in" class="pull-right btn-sm btn-default" />
}
</section>
</div>
</div>
</div>
</div>
This is my css:
.login-centered {
display:block;
margin-left:auto;
margin-right:auto;
}
.panel-heading {
background-color: #2190b6!important;
}
.btn-default {
background-color: #2190b6 !important;
border: 1px solid #2190b6 !important;
color: #FFF!important;
margin-top: 10px;
}
.btn-default:hover, .btn-default:active:focus{
background-color: #2190b6 !important;
border: 1px solid #2190b6 !important;
color: #FFF!important;
}
The following CSS code should do the job !!
.login-centered {
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
position: absolute;
}

Bootstrap Responsive container gets height cropped

I am quite new to Bootstrap. I tried to create a boostrap slider that contains on the left side a container with a logo, some text and on the right side a login form. Unfortunately my code is not working properley and my logo and the html form gets cropped once the browsers has a reduced resolution shrinks.
Here is my code: https://jsfiddle.net/bebetxx/z7w2bbso/3/
my CSS
.blue-container
{
color: white;
background-color:#3C8DBC;
}
.blue-container h2,p
{
color: #D2D6DE;
}
.black-container
{
background-color: #2D2D2D;
}
.black-container h2,p
{
color: #BBBBBB;
}
.image-container
{
background: url("http://www.hogash-demos.com/ammon_html/images/sliders/full-slider/slide4.jpg") no-repeat center center scroll;
background-size: cover;
min-height: 350px;
height: 350px;
overflow: hidden;
}
/*SLIDER HEADER
============================================================*/
.slider {
background: url("http://www.hogash-demos.com/ammon_html/images/sliders/full-slider/slide4.jpg")no-repeat center center scroll;
background-size: cover;
min-height: 450px;
height: 300px;
overflow: hidden;
}
.slider-wrap{
padding: 10px 0px;
}
.slider-img{}
.slider-img img{
width: 300px;
height: 500px;
}
.slider{}
.slider-content{
padding-top: 80px;
}
.slider h1 {
margin: 0 0 20px 0;
font-size: 50px;
color: #fff;
text-transform: uppercase;
line-height: 60px;
font-weight: 700;
}
.slider h2 {
font-family: 'lora', serif;
font-style: normal;
color: #fff;
text-transform: capitalize;
font-size: 27px;
text-shadow: 2px 5px 4px #000000;
}
.slider p {
margin-bottom: 25px;
color: #fff;
}
.top-link {
margin-top: 60px;
}
.top-link a{
padding: 20px 30px;
border-radius: 3px;
background: #fff;
font-weight: 700;
-webkit-transition: all .3s linear 0s;
-o-transition: all .3s linear 0s;
transition: all .3s linear 0s;
}
.top-link a i{
color: #00AEFF;
font-size: 25px;
margin-right: 10px;
}
.top-link a:hover{
background: #00AEFF;
color: #fff;
}
.top-link a:hover i{
color: #fff;
}
.logo-slider {
position:relative;
width: 100% !important;
background-size:cover;
padding-bottom: 35%;
background-repeat: no-repeat;
background-size: auto;
max-width: 100%;
}
<!-- Main content -->
<!-- slider section -->
<section class="slider">
<div class="slider-wrap" >
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-1 "><div class="logo-slider" style="background-image:url(http://design.ubuntu.com/wp-content/uploads/ubuntu-logo32.png)"></div><h2>Connect, discover & change the world</h2><ul class="top-link list-inline"><li><i class="fa fa-android"></i> Register</li></ul></div><a name="loginbox"></a>
<div id="loginbox" style="margin-top:10px;" class="col-md-4 col-md-offset-0 col-sm-8 col-sm-offset-2">
<div class="panel panel-info" >
<div class="panel-heading">
<div class="panel-title">Sign In</div>
<div style="float:right; font-size: 80%; position: relative; top:-10px">Forgot password?</div>
</div>
<div style="padding-top:30px" class="panel-body" >
<div style="display:none" id="login-alert" class="alert alert-danger col-sm-12"></div>
<form id="loginform" class="form-horizontal" action="http://127.0.0.1/login#Login" role="form" method="post">
<div style="margin-bottom: 25px" class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
<input id="login-username" type="text" class="form-control" name="username" value="" placeholder="username or email">
</div>
<div style="margin-bottom: 25px" class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
<input id="login-password" type="password" class="form-control" name="password" placeholder="password">
</div>
<input type="hidden" name="val" value="checkin">
<div class="input-group">
<div class="checkbox">
<label>
<input id="login-remember" type="checkbox" name="remember" value="1"> Remember me
</label>
</div>
</div>
<div style="margin-top:10px" class="form-group">
<!-- Button -->
<div class="col-sm-12 controls">
<input type="submit" value="Login" class="btn btn-success">
<a id="btn-fblogin" href="#" class="btn btn-primary">Login with Facebook</a>
</div>
</div>
<div class="form-group">
<div class="col-md-12 control">
<div style="border-top: 1px solid#888; padding-top:15px; font-size:85%" >
Don't have an account?
<a href="http://127.0.0.1/#Registration" <!--onClick="$('#loginbox').hide(); $('#signupbox').show()" -->
<strong>Sign Up Now</strong>
</a>
</div>
</div>
</div>
</form>
</div>
</div> </div>
</div>
</div> <!-- row end -->
</div> <!-- container end -->
</section>
<section id="counter-area" class="blue-container">
<div class="container">
<div class="row">
<div class="heading-inner text-center">
<h2 class="sec-title">Register to <span style="color:white !important"><?php if (isset($g_sWebsiteName)) echo $g_sWebsiteName ?> </span> </h2>
<p><strong>Register right away to this amazing community</strong></p>
<?php
$this->view('registration_box');
?>
</div>
</div> <!-- heading row end -->
</div> <!-- container end -->
</section>
thanks to #Skelly the 2nd problem was that the main slider has a height:300px limit.
The 1st problem was solved using a instead of the div logo used

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

Centering bootstrap 3 buttons

I have three buttons, two of which only appear on mobile sized screens. I would like all three buttons to remain centered on various mobile size screens however two of them (email & call), do not remain centered.
These two adjust according to the screen yet apply now does not. How do I keep them centered?
Here is my code pen: codepen
here is the relevant html:
<div id="directions" class="container–fluid">
<div class="container">
<!-- Example row of columns -->
<div class="row" id="ab">
<div class="col-md-6">
<h2><img class="img–responsive" src="img/logo1_03.png"></h2>
<div id="dd">
<a class="btn btn-success btn-lg myButton" href="#" role="button">Apply Now »</a>
<div id="dd">
<a class="btn btn-info visible-xs btn-lg myButton" href="#" role="button">Email »</a>
</div>
<div id="dd"><a class="btn btn-success visible-xs btn-lg myButton" href="#" role="button">Call »</a>
</div>
<br>
<br>
<br>
<div class="row" id="cb">
<div class="col-md-10 hidden-xs">
<p id="shop">Shop Smart</p>
<p id="save">Save Smart</p>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<form class="hidden-sm hidden-xs well" id="contact" role="form">
<h1>Contact us</h1>
<div class="form-group">
<input type="text" class="form-control" id="firstname" placeholder="First Name">
</div>
<div class="form-group">
<input type="text" class="form-control" id="lastname" placeholder="Last Name">
</div>
<div class="form-group">
<input type="text" class="form-control" id="companyname" placeholder="Company Name">
</div>
<div class="form-group">
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">
</div>
<div class="form-group">
<input type="tel" class="form-control" id="exampleInputtel1" placeholder="Phone">
</div>
<button type="submit" class="btn btn-default"> Submit</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
Here is my CSS (not the bootstrap):
#directions{
height: 500px;
background-image: url("../img/terminals-body2feather.jpg");
background-repeat: no-repeat;
background-position:center;
background-color: white;
border: 5px solid black;
}
/*.jumbotron {
background-image: url("../img/terminals-body2feather.jpg");
height: 500px;
background-repeat: no-repeat;
background-position:center;
background-color: white;
line-height: 0;
border: 2px solid black;
}*/
#logo{
margin-top: 1em;
border: 2px solid black;
}
#contact{
border: 2px solid black;
width: 300px;
padding-top: 10px;
margin-top: 20px;
}
#contact h1{
text-align: center;
margin-bottom: 5px;
margin-top: 0px;
}
#ab{
border: 2px solid black;
}
#cb{
height: 250px;
}
.col–md–5{
}
.col–md–4{
height: 160px;
border: 2px solid black;
text-align: center;
margin-top: 1em;
}
#head {
line-height: 0;
}
#shop {
background-color: rgba(0, 0, 0, 0.498);
font: 64px 'roboto';
color: #FFF;
margin-bottom: 0px;
margin-top: 20px;
text-align: center;
}
#save {
background-color: rgba(0, 0, 0, 0.498);
font: 78px/70px 'roboto';
color: #1A8AF7;
margin-bottom: 0px;
padding-bottom: 5px;
text-align: center;
}
#adv {
text-align: center;
border: 2px solid black;
}
.myButton {
width: 150px;
}
#media (min-width: 768px) and (max-width: 1160px) {
.nav > li > a {
font-size: 12px;
padding-left: 10px;
padding-right: 10px; }
#top {
padding-right:0px;
padding-left:0px;
}
h2{
text-align:center;
}
#dd {
margin:0 auto;
width:50%;
text-align: center;
}
#shop {
font: 44px 'roboto';}
#save {
font: 58px/55px 'roboto';
}
}
#media (max-width: 767px) {
#directions{
height: 300px;
}
h2{
text-align:center;
}
#dd {
margin:15px auto;
width:50%;
text-align: center;
I can't identify the css differences between "apply now" and the other two buttons.
You're missing a </div>
<div id="dd">
<a class="btn btn-success btn-lg myButton" href="#" role="button">Apply Now »</a>
</div> <!-- You're missing this close DIV! -->
<div id="dd">
<a class="btn btn-info visible-xs btn-lg myButton" href="#" role="button">Email »</a>
</div>
<div id="dd">
<a class="btn btn-success visible-xs btn-lg myButton" href="#" role="button">Call »</a>
</div>
The difference is that the two other buttons is wrapped inside another #dd.
Know that it is not valid html to have multiple id's with the same name on one page. Instead use classes.
The bootstrap classes visible-xs made the two buttons display:block. When I changed their display to display:inline-block my centering method of text-align:center worked.

Resources