hello I one simple but annoying problem. I managed to use css and bootsatrap to create the responsive webpage that i wanted. However, when i used position:relative my input (text field) got disabled. Any idea why?
<div class="col-md-offset-2 col-md-8 text-center">
<div class="container-fluid">
<div id="logo">
<img class="img-responsive" src="uv.png">
</div>
<div class="login-form">
<h1>United Volunteers</h1>
<div class="form-group">
<label class="input-title">Username</label>
<input type="text" class="form-input" placeholder="Username">
</div>
<div class="form-group">
<label class="input-title">Password</label>
<input type="password" class="form-input" placeholder="Password">
</div>
</div>
</div>
</div>
.login-form {
top:90px;
position:relative;
box-sizing: border-box;
margin: 25px auto;
margin-bottom:0px;
width: 100%;
max-width:400px;
background-color: white;
padding: 100px 50px 50px 50px;
box-shadow: 1px 5px 2px #330000;
z-index: -1;
}
.form-input {
width: 100%;
display: block;
height: 35px;
padding: 6px 12px;
font-size: 12px;
font-family: sans-serif;
vertical-align: middle;
border: 1px solid #ccc;
border-radius: 4px;
background-color: #f2f2f2;
line-height: 1.5;
}
This is because of z-index: -1;. Its set to negative value.
Just make it positive like:
.login-form {
z-index: 1;
}
Or look at the snippet below:
.login-form {
top:90px;
position:relative;
box-sizing: border-box;
margin: 25px auto;
margin-bottom:0px;
width: 100%;
max-width:400px;
background-color: white;
padding: 100px 50px 50px 50px;
box-shadow: 1px 5px 2px #330000;
z-index: 1;
}
.form-input {
width: 100%;
display: block;
height: 35px;
padding: 6px 12px;
font-size: 12px;
font-family: sans-serif;
vertical-align: middle;
border: 1px solid #ccc;
border-radius: 4px;
background-color: #f2f2f2;
line-height: 1.5;
}
<div class="col-md-offset-2 col-md-8 text-center">
<div class="container-fluid">
<div id="logo">
<img class="img-responsive" src="uv.png">
</div>
<div class="login-form">
<h1>United Volunteers</h1>
<div class="form-group">
<label class="input-title">Username</label>
<input type="text" class="form-input" placeholder="Username">
</div>
<div class="form-group">
<label class="input-title">Password</label>
<input type="password" class="form-input" placeholder="Password">
</div>
</div>
</div>
</div>
Hope this helps!
Related
I am newbie in bootstrap and front design. I want to make a page in MVC and CSS and bootstrap, a template like the following
So I want the page be resized from the left and right side of this picture, not by whole part of the image .
This Code doesn't make what I want, when browser size increased it increases the frame with shadow.
.page-account-box .picture-box {
width: 100%;
padding: 0;
}
.page-account-box .picture-box .imgFormat {
-moz-box-shadow: 10px 10px 5px #ccc;
-webkit-box-shadow: 10px 10px 5px #ccc;
box-shadow: 10px 10px 5px #ccc;
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
border-radius: 25px;
position: relative;
top: 50px;
left: 150px;
background-color: darkgoldenrod;
}
.page-account-box {
width: 100%;
height: auto;
padding: 0;
border: 1px solid #e2efef;
-webkit-box-shadow: 0 12px 12px 0 hsla(0, 0%, 70.6%, .11);
box-shadow: 0 15px 23px 0 hsla(0, 0%, 71%, 0.29);
position: relative;
margin: 50px auto 30px;
background-color: aqua;
border-radius: 20px;
}
.page-account-box .ds-userlogin {
width: 100%;
height: auto;
padding: 0;
margin: 10px auto 10px;
background-color: blueviolet;
}
.page-account-box .ds-userlogin .account-box .Login-to-account .account-box-content {
min-height: 100%;
text-align: center;
border-radius: 20px;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.6.1/dist/css/bootstrap.min.css" integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="page-account-box">
<div class="col-lg-1 col-md-1 col-xs-6 ">
<div class="picture-box">
<img src="https://via.placeholder.com/600" class="imgFormat" />
</div>
</div>
<div class="col-lg-4 col-md-4 col-xs-8 mx-auto">
<div class="ds-userlogin">
<div class="account-box">
<div class="Login-to-account mt-4">
<div class="account-box-content">
<form method="post" class="form-account text-right">
<div class="form-account-title">
<label for="email-phone">Name</label>
<input type="text" class="number-email-input" id="FullName">
</div>
<div class="form-account-title">
<label for="email-phone">Email</label>
<input type="email" class="number-email-input" id="Email">
</div>
<div class="form-account-title">
<label for="password">password</label>
<input type="password" class="password-input" id="Password">
</div>
<div class="form-row-account">
<a onclick="Registeruser()" class="btn btn-primary btn-register">ثبت </a>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
You'll want to use the img-fluid class on your image to prevent it from being larger than the container, and you'll want to position and size the container instead of the image, along with the outer elements. Notice overflow-hidden, which forces containment, and max-width, which accommodates your left position. That might be better handled with padding on the container.
.page .account-box {
max-width: calc(100% - 150px);
}
.page-account-box .picture-box {
width: 100%;
padding: 0;
}
.page-account-box .picture-box {
box-shadow: 10px 10px 5px #ccc;
border-radius: 25px;
position: relative;
top: 50px;
left: 150px;
max-width: calc(100% - 150px);
background-color: darkgoldenrod;
}
.page-account-box {
border: 1px solid #e2efef;
box-shadow: 0 15px 23px 0 hsla(0, 0%, 71%, 0.29);
position: relative;
margin: 50px auto 30px;
background-color: aqua;
border-radius: 20px;
}
.page-account-box .ds-userlogin {
width: 100%;
height: auto;
padding: 0;
margin: 10px auto 10px;
background-color: blueviolet;
}
.page-account-box .ds-userlogin .account-box .Login-to-account .account-box-content {
min-height: 100%;
text-align: center;
border-radius: 20px;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.6.1/dist/css/bootstrap.min.css" integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="page-account-box">
<div class="col-lg-1 col-md-1 col-xs-6 overflow-hidden">
<div class="picture-box">
<img src="https://via.placeholder.com/600" class="img-fluid" />
</div>
</div>
<div class="col-lg-4 col-md-4 col-xs-8 mx-auto">
<div class="ds-userlogin">
<div class="account-box">
<div class="Login-to-account mt-4">
<div class="account-box-content">
<form method="post" class="form-account text-right">
<div class="form-account-title">
<label for="email-phone">Name</label>
<input type="text" class="number-email-input" id="FullName">
</div>
<div class="form-account-title">
<label for="email-phone">Email</label>
<input type="email" class="number-email-input" id="Email">
</div>
<div class="form-account-title">
<label for="password">password</label>
<input type="password" class="password-input" id="Password">
</div>
<div class="form-row-account">
<a onclick="Registeruser()" class="btn btn-primary btn-register">ثبت </a>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Im trying to make two froms on one page. one right underneather the other. The first form is to put the main information in and then the second form is suppossed to be a report. The problem is that the second form wont allow any text to be put into the text box, it doesnt even seem to regonise that there is a text box on the page.
Any ideas why this might be happening?
Thanks
* {
box-sizing: border-box;
}
#tl {
padding: 1em;
background: #f9f9f9;
border: 1px solid #c1c1c1;
margin-top: 2rem;
width: 1400px;
height:190px;
margin-left: auto;
margin-right: auto;
padding: 1em;
text-transform: uppercase;
}
#tl input {
margin-bottom: 1rem;
background: #fff;
border: 1px solid #9c9c9c;
}
#report {
padding: 1em;
background: #f9f9f9;
border: 1px solid #c1c1c1;
margin-top: 2rem;
width: 1400px;
height:690px;
margin-left: auto;
margin-right: auto;
padding: 1em;
text-transform: uppercase;
}
#report input {
margin-bottom: 1rem;
background: #fff;
border: 1px solid #9c9c9c;
}
.fdate{
position:relative;
left:60px;
top:30px;
}
.fsales{
position:relative;
left:320px;
bottom:22px;
}
.fservice{
position:relative;
left:650px;
bottom:75px;
}
.fpart{
position:relative;
left:1000px;
bottom:127px;
}
.fqty{
position:relative;
left:20px;
bottom:120px;
}
.fhour{
position:relative;
left:376px;
bottom:175px;
}
.fcust{
position:relative;
left:691px;
bottom:225px;
}
.fname{
position:relative;
left:1068px;
bottom:280px;
}
.inputs{
position:relative;
top: 20px;
}
.title1{
position:relative;
bottom:430px;
left:500px;
}
<!--form for top level info-->
<div id = "tl">
<form>
<div class = "inputs">
<div class="fdate">
<label for="fdate">Date:</label>
<input type="text" id="fdate" name="fdate"><br><br>
</div>
<div class="fsales">
<label for="fsales">Sales Order:</label>
<input type="text" id="fsales" name="fsales"><br><br>
</div>
<div class="fservice">
<label for="fservice">Service Order:</label>
<input type="text" id="fservice" name="fservice"><br><br>
</div>
<div class="fpart">
<label for="fpart">Part Number:</label>
<input type="text" id="fpart" name="fpart"><br><br>
</div>
<div class="fqty">
<label for="fqty">Quantity:</label>
<input type="text" id="fqty" name="fqty"><br><br>
</div>
<div class="fhour">
<label for="fhour">Hours:</label>
<input type="text" id="fhour" name="fhour"><br><br>
</div>
<div class="fcust">
<label for="fcust">Customer:</label>
<input type="text" id="fcust" name="fcust"><br><br>
</div>
<div class="fname">
<label for="fname">Name:</label>
<input type="text" id="fname" name="fname"><br><br>
</div>
</div>
<div class = "title1">
<div> Missing & Damaged Report</div>
</div>
</form>
</div>
<!--second form for missing parts-->
<div id = "report">
<form>
<div class="P1">
<label for="P1">Part Number:</label>
<input type="text" id="P1" name="P1"><br><br>
</div>
</form>
</div>
The problem is postion:relative; to input class see work example:
* {
box-sizing: border-box;
}
#tl {
padding: 1em;
background: #f9f9f9;
border: 1px solid #c1c1c1;
margin-top: 2rem;
width: 1400px;
height:190px;
margin-left: auto;
margin-right: auto;
padding: 1em;
text-transform: uppercase;
}
#tl input {
margin-bottom: 1rem;
background: #fff;
border: 1px solid #9c9c9c;
}
#report {
padding: 1em;
background: #f9f9f9;
border: 1px solid #c1c1c1;
margin-top: 2rem;
width: 1400px;
height:690px;
margin-left: auto;
margin-right: auto;
padding: 1em;
text-transform: uppercase;
}
#report input {
margin-bottom: 1rem;
background: #fff;
border: 1px solid #9c9c9c;
}
.fdate{
position:relative;
left:60px;
top:30px;
}
.fsales{
position:relative;
left:320px;
bottom:22px;
}
.fservice{
position:relative;
left:650px;
bottom:75px;
}
.fpart{
position:relative;
left:1000px;
bottom:127px;
}
.fqty{
position:relative;
left:20px;
bottom:120px;
}
.fhour{
position:relative;
left:376px;
bottom:175px;
}
.fcust{
position:relative;
left:691px;
bottom:225px;
}
.fname{
position:relative;
left:1068px;
bottom:280px;
}
.inputs{
top: 20px;
}
.title1{
position:relative;
bottom:430px;
left:500px;
}
<!--form for top level info-->
<div id = "tl">
<form>
<div class = "inputs">
<div class="fdate">
<label for="fdate">Date:</label>
<input type="text" id="fdate" name="fdate"><br><br>
</div>
<div class="fsales">
<label for="fsales">Sales Order:</label>
<input type="text" id="fsales" name="fsales"><br><br>
</div>
<div class="fservice">
<label for="fservice">Service Order:</label>
<input type="text" id="fservice" name="fservice"><br><br>
</div>
<div class="fpart">
<label for="fpart">Part Number:</label>
<input type="text" id="fpart" name="fpart"><br><br>
</div>
<div class="fqty">
<label for="fqty">Quantity:</label>
<input type="text" id="fqty" name="fqty"><br><br>
</div>
<div class="fhour">
<label for="fhour">Hours:</label>
<input type="text" id="fhour" name="fhour"><br><br>
</div>
<div class="fcust">
<label for="fcust">Customer:</label>
<input type="text" id="fcust" name="fcust"><br><br>
</div>
<div class="fname">
<label for="fname">Name:</label>
<input type="text" id="fname" name="fname"><br><br>
</div>
</div>
<div class = "title1">
<div> Missing & Damaged Report</div>
</div>
</form>
</div>
<!--second form for missing parts-->
<div id = "report">
<form>
<div class="P1">
<label for="P1">Part Number:</label>
<input type="text" id="P1" name="P1"><br><br>
</div>
</form>
</div>
Im using bootstrap 3 with flexbox in order to achieve the output. To explain, I am creating a login screen where the left div has a background-image that completely covers the div and on the right side is the form container together with it form contents. I've provided a snippet to show what I am trying to do.
#page-login-template {
margin-top: -32px;
.column-wrapper{
display:flex;
}
.login-left {
background-image: url("assets/images/web_login#2x.png");
background-repeat: no-repeat;
background-size: 100% 100%;
}
.login-right {
padding: 0 100px;
.login-logo {
padding:99px 0;
}
h4 {
font-family: Poppins;
font-size: 18px;
color: #0392cc;
}
.form-container {
padding: 20px 0;
.form-part-group {
padding: 10px 0;
}
[type=email],
[type=password],[type=text] {
height: 40px;
font-size: 18px;
font-family: Poppins;
color: #333;
}
[type=password],[type=text]{
border-right:0;
}
.input-group-addon {
background-color: white;
border-right: 1px solid #e9e9e9;
border-left:0;
border-top:1px solid #e9e9e9;
border-bottom: 1px solid #e9e9e9;
}
i{
font-size:18px;
}
.btn-login{
height:54px;
font-size:16px;
font-family:Poppins;
color:#fff;
background:#0570B6;
box-shadow: 0px 3px 6px #00000029;
}
.btn-login:hover{
background:#0570B6;
}
}
.form-container-2{
padding:20px 0;
p{
font-family: Poppins;
font-size: 12px;
color:#333;
font-weight:bold;
}
a{
color:#0392CC
}
}
.form-container-3{
padding-top:180px;
p{
font-family: Poppins;
font-size: 11px;
color:#333;
font-weight:bold;
}
a{
color:#0392CC
}
}
}
}
<div id="page-login-template" class="container-fluid">
<div class="row column-wrapper">
<div class="col-lg-7 login-left"></div>
<div class="col-lg-5 login-right">
<div class="row login-logo text-center">
<img src='<?= get_stylesheet_directory_uri() . '/assets/images/logo/logo#2x.png' ?>' width="50%">
</div>
<h4 class="text-center">Login to My Account</h4>
<div class="row form-container">
<form class="form-horizontal">
<div class="row">
<div class="form-part-group col-lg-12">
<input id="email" type="email" class="form-control form-input-group email-input" data-error-required="This field is required" data-class-focus="email-input" placeholder="Email">
<div id="email" class="error-block"></div>
</div>
</div>
<div class="row form-part-group">
<div class="input-group col-lg-12 password-input">
<input id="password" type="password" class="form-control form-input-group" data-error-required="This field is required" data-class-focus="password-input" placeholder="Password">
<div class="input-group-addon">
<i class="fa fa-eye-slash password-eye hide-password "></i>
</div>
</div>
<div id="password" class="error-block"></div>
</div>
<div class="row">
<div class="form-part-group col-lg-12">
<button type="button" class="btn btn-block btn-login" disabled>Log In</button>
</div>
</div>
</form>
<div class="row form-container-2 text-center">
<p>Don't have an account yet? Create An Account Now</p>
</div>
<div class="row form-container-3 text-center">
<p>Copyright © 2020. All Rights Reserved.</p>
<p>Terms & Conditions and Data Privacy Policy
</div>
</div>
</div>
</div>
</div>
As you can see I am controlling the height of the layout via padding the contents on the form. Is there a way to have the same output without it being dependent on the form's height.
height: 100vh;
This code can make your div same height as screen
First thing that you need to do is to set on "column-wrapper" class:
height: 100vh;
You probably need something like this, just group the div's in a way that you like:
JSFiddle
Try this. You need to set elements to height 100% or 100vh. And the right part is better to make with the flexbox.
html,
body {
height: 100%;
}
#page-login-template{
height: 100%;
}
.column-wrapper {
display: flex;
height: 100%;
}
.login-left {
background-image: url("https://source.unsplash.com/user/erondu/1600x900");
background-repeat: no-repeat;
background-size: cover;
height: 100%;
}
.login-logo{
padding-top:100px;
}
.login-right {
height: 100%;
overflow-y: auto;
display: flex;
flex-direction: column;
justify-content: space-between;
}
h4 {
font-family: Poppins;
font-size: 18px;
color: #0392cc;
}
.form-container {
padding: 20px 0;
}
.form-part-group {
padding: 10px 0;
}
[type=email],
[type=password],
[type=text] {
height: 40px;
font-size: 18px;
font-family: Poppins;
color: #333;
}
[type=password],
[type=text] {
border-right: 0;
}
.input-group-addon {
background-color: white;
border-right: 1px solid #e9e9e9;
border-left: 0;
border-top: 1px solid #e9e9e9;
border-bottom: 1px solid #e9e9e9;
}
.input-group-addon i {
font-size: 18px;
}
.btn-login {
height: 54px;
font-size: 16px;
font-family: Poppins;
color: #fff;
background: #0570B6;
box-shadow: 0px 3px 6px #00000029;
}
.btn-login:hover {
background: #0570B6;
}
.form-container-2 {
padding: 20px 0;
}
.form-container-2 p {
font-family: Poppins;
font-size: 12px;
color: #333;
font-weight: bold;
}
.form-container-2 a {
color: #0392CC
}
.form-container-3 p {
font-family: Poppins;
font-size: 11px;
color: #333;
font-weight: bold;
}
.form-container-3 a {
color: #0392CC
}
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">
<div id="page-login-template" class="container-fluid">
<div class="row column-wrapper">
<div class="col-md-7 login-left"></div>
<div class="col-md-5 login-right">
<div class="row login-logo text-center">
<img src='https://source.unsplash.com/random/200x200>' height="150">
</div>
<div class="form-container">
<h4 class="text-center">Login to My Account</h4>
<form>
<div class="form-group">
<input id="email" type="email" class="form-control form-input-group email-input"
data-error-required="This field is required" data-class-focus="email-input"
placeholder="Email">
<div id="email" class="error-block"></div>
</div>
<div class="form-group">
<input id="password" type="password" class="form-control form-input-group"
data-error-required="This field is required" data-class-focus="password-input"
placeholder="Password">
<div class="input-group-addon">
<i class="fa fa-eye-slash password-eye hide-password "></i>
</div>
<div id="password" class="error-block"></div>
</div>
<div class="form-group">
<button type="button" class="btn btn-block btn-login" disabled>Log In</button>
</div>
</form>
</div>
<div>
<div class="row form-container-2 text-center">
<p>Don't have an account yet? Create An Account Now</p>
</div>
<div class="row form-container-3 text-center">
<p>Copyright © 2020. All Rights Reserved.</p>
<p>Terms & Conditions and Data Privacy Policy
</div>
</div>
</div>
</div>
</div>
I'm trying to float 2 divs next to each other and I want the right div to give a margin in relation to it's parent while the left div is shown in front of the margin of the right div.
I have this code below with some labels and input fields. I gave the inputwrapper a margin-left of 220px to align the inputfields vertically but they don't.
So my quetion is how to get these inputfields vertically aligned without using a table?
Thanks in advance
Code snippet:
* {
box-sizing: border-box;
}
html, body {
margin: 0px;
padding: 0px;
font-family: Geneva, sans-serif;
font-size: 13pt;
}
.registerwrapper {
border: 1px black solid;
height: auto !important;
width: 600px;
display: block;
padding: 10px;
margin: 50px auto;
}
.labelwrapper {
border: 1px red solid;
float: left;
display: block;
z-index: 100;
}
.inputwrapper {
border: 1px blue solid;
margin-left: 220px;
float: left;
display: block;
z-index: 1;
}
.row {
border: blueviolet 1px solid;
position: relative;
padding: 3px;
width: auto!important;
display: block;
overflow: auto;
}
.row:after {
content: "";
clear: both;
display: block;
}
<html>
<head>
<title></title>
<link rel="stylesheet" href="css/layout_register.css" />
</head>
<body>
</body>
<div class="registerwrapper">
<form action="" method="post">
<div class="row">
<div class="labelwrapper"><label for="username">Username:</label></div>
<div class="inputwrapper"><input type="text" name="username" id="username" value="" autocomplete="off" /></div>
</div>
<div class="row">
<div class="labelwrapper"><label for="password">Choose a password:</label></div>
<div class="inputwrapper"><input type="password" name="password" id="password" /></div>
</div>
<div class="row">
<div class="labelwrapper"><label for="password_again">Enter your password again:</label></div>
<div class="inputwrapper"><input type="password" name="password_again" id="password_again" /></div>
</div>
<div class="row">
<div class="labelwrapper"><label for="name">Name:</label></div>
<div class="inputwrapper"><input type="text" name="name" id="name" value="" autocomplete="off" /></div>
</div>
<div class="row">
<div class="inputwrapper"><input type="submit" value="Register" /></div>
</div>
</form>
</div>
</body>
</html>
Use position: absolute; for labelwrapper class.
* {
box-sizing: border-box;
}
html, body {
margin: 0px;
padding: 0px;
font-family: Geneva, sans-serif;
font-size: 13pt;
}
.registerwrapper {
border: 1px black solid;
height: auto !important;
width: 600px;
display: block;
padding: 10px;
margin: 50px auto;
}
.labelwrapper {
position: absolute;
border: 1px red solid;
float: left;
display: block;
z-index: 100;
}
.inputwrapper {
border: 1px blue solid;
margin-left: 220px;
float: left;
display: block;
z-index: 1;
}
.row {
border: blueviolet 1px solid;
position: relative;
padding: 3px;
width: auto!important;
display: block;
overflow: auto;
}
.row:after {
content: "";
clear: both;
display: block;
}
<html>
<head>
<title></title>
<link rel="stylesheet" href="css/layout_register.css" />
</head>
<body>
</body>
<div class="registerwrapper">
<form action="" method="post">
<div class="row">
<div class="labelwrapper"><label for="username">Username:</label></div>
<div class="inputwrapper"><input type="text" name="username" id="username" value="" autocomplete="off" /></div>
</div>
<div class="row">
<div class="labelwrapper"><label for="password">Choose a password:</label></div>
<div class="inputwrapper"><input type="password" name="password" id="password" /></div>
</div>
<div class="row">
<div class="labelwrapper"><label for="password_again">Enter your password again:</label></div>
<div class="inputwrapper"><input type="password" name="password_again" id="password_again" /></div>
</div>
<div class="row">
<div class="labelwrapper"><label for="name">Name:</label></div>
<div class="inputwrapper"><input type="text" name="name" id="name" value="" autocomplete="off" /></div>
</div>
<div class="row">
<div class="inputwrapper"><input type="submit" value="Register" /></div>
</div>
</form>
</div>
</body>
</html>
Just change the following classes in your css file
.labelwrapper {
border: 1px red solid;
float: left;
}
.inputwrapper {
border: 1px blue solid;
float: right;
margin-right:100px;
}
I am trying to position a div with arrow in bootstrap form field but the pointing arrow is pointing to the next row. Here is my code:
<h3>Rregistration </h3>
<div class="control-group">
<label class="control-label" for="inputName">Name</label>
<div class="controls">
<input type="text" id="inputName" placeholder="Name">
</div>
</div>
<div class="container">
<div id="pointer"></div>
</div>
and the CSS
.container {
margin-top: 10px;
}
body {background:#ff004e;padding:40px}
.container {
background:white;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
width:250px;
height:100px;
display: block;
position: relative;
}
#pointer{
border-right:solid 20px #FFF;
/* border-left: solid 5px transparent; */
border-top: solid 10px transparent;
border-bottom: solid 10px transparent;
position:absolute;
width: 0;
height: 0;
top: 10px;
left:-20px
}
The JsFiddle link is here: http://jsfiddle.net/barnamah/Epj6z/13/
try this
http://jsfiddle.net/Epj6z/15/
<h3>Rregistration </h3>
<div class="control-group">
<label class="control-label" for="inputName">Name</label>
<div class="controls">
<input type="text" id="inputName" placeholder="Name" style="float:left">
<div class="span3">
<div id="pointer"></div>
</div>
</div>
</div>
body {background:#ff004e;padding:40px}
.span3 {
background:white;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
width:250px;
height:100px;
display: block;
position: relative;
}