Putting a checkbox, label and input box next to each other - html

I am trying to put a checkbox, label and input box next to each other.
I separated it into divs and and put divs side-by-side.
I was able to get the buttons center but they are to close together which I am trying to fix too.
My question is how can I get <div class="col-centered border"> into a smaller border and put a checkbox, label and input box next to each other. In the end I want the buttons and all as a container.
html
<div class="col-centered border">
<form>
<div class="first">
<div class="form-group">
<input type="checkbox" class="form-check-input">
<label for="ssn">SSN:</label>
<input type="text" class="form-control-file" id="ssn" placeholder="Social Security Number">
</div>
<div class="form-group row">
<input type="checkbox" class="form-check-input">
<label for="lastname">Lastname:</label>
<input type="text" class="form-control-file" id="lastname" placeholder="Password">
</div>
<div class="form-group row">
<input type="checkbox" class="form-check-input">
<label for="role">Role:</label>
<input type="text" class="form-control-file" id="role" placeholder="Password">
</div>
</div>
<div class="second">
<div class="form-group row">
<input type="checkbox" class="form-check-input">
<label for="userId">User ID:</label>
<input type="text" class="form-control-file" id="userId" placeholder="User Id">
</div>
<div class="form-group row">
<input type="checkbox" class="form-check-input">
<label for="office">Office</label>
<input type="text" class="form-control-file" id="office" placeholder="Office">
</div>
<input type="checkbox">Include Subordinates
</div>
<div class="center-block lower-button">
<div class="center-block">
<button type="submit" class="btn btn-default btn-md left-button">Search</button>
<button type="submit" class="btn btn-default btn-md right-button">Reset</button>
</div>
</div>
</form>
</div>
css
.first {
width: 100px;
float: left;
padding-left: 450px;
}
.second {
width: 200px;
float: right;
padding-right: 950px;
}
.col-centered{
padding-top: 30px;
float: none;
margin: 0 auto;
}
.btn-beside {
position: center;
left: 100%;
top: 0;
margin-left: -10px;
}
.lower-button{
padding-top:250px;
padding-left:575px;
}
.left-button{
padding-right: -14px;
}
.form-group{
text-align: center;
}
I am using bootstrap

Here's a Fiddle for you to take inspiration from.
HTML
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="input-group">
<span class="input-group-addon">
<input type="checkbox">
</span>
<span class="input-group-addon">
<label for="tbox">My Label</label>
</span>
<input type="text" id="tbox" class="form-control">
</div>
</div>
</div>
</div>
As per the official documentation for Bootstrap.

Related

Boostrap CSS How to make span, input text, checkbox in one line?

Hi
I using css and boostrap.
I have a span, input, checkbox which i want to put into one line.
But it came out like in the picture. The checkbox drop down to second line.
Here is the code.
<div class="row">
<div class="col-lg-6 col-md-6 col-xs-12 col-sm-12 textfield">
<label>
<span style="width: 55%; display:inline-block;" type="text" class="display-control backgroundcolor" value="">Gym<span style="color: Red; font-weight:800;font-size:larger;">*</span></span>
<input style="width: 33%; display: inline-block; text-align: right;" type="number" id="Amount" name="Amount" class="form-control" value="0.00">
<label class="checkbox">
<input type="checkbox" class="checkbox__control" name="Facilities" data="Gym" id="F011">
<span style="float: right; width: 11%;" class="checkbox__label"> </span>
</label>
</label>
</div>
<div class="col-lg-6 col-md-6 col-xs-12 col-sm-12 textfield">
<label>
<span style="width: 55%; display:inline-block;" type="text" class="display-control backgroundcolor" value="">Mall<span style="color: Red; font-weight:800;font-size:larger;">*</span></span>
<input style="width: 33%; display:inline-block; text-align:right;" type="number" id="Amount" name="Amount" class="form-control" value="0.00">
<label class="checkbox">
<input type="checkbox" class="checkbox__control" name="Facilities" data="Mall*" id="F012">
<span style="float: right; width: 11%;" class="checkbox__label"> </span>
</label>
</label>
</div>
</div>
Hope someone can help on this. Thank
<div class="checkbox__control">
<input type="checkbox" class="checkbox__control" id="exampleCheck1">
<label class="checkbox__control" for="exampleCheck1">Check me out</label>
</div>
try this one . .

trouble aligning the divs and other inner tags at different positions

I'm creating my first ever html page, and I'm trying to do some alignment for divs and labels.
The labels and the input seem out of position even after spending multiple hours trying different combinations. Some properties are not working, like I used width for label and in chrome it says unknown property.
Below is the code. Any help with this would be appreciated.
Preview of the html/css part:
div.btn-toolbar {
position: relative;
top: 100px;
left: 40%;
width: 400px;
}
div.quote-details {
position: relative;
top: 122px;
left: 250px;
font-weight: bold;
font-size: 15px;
}
div.quote-detail-section-left {
float: left;
margin-top: 145px;
margin-left: 100px;
width: 35%;
}
input.quote-input {
padding: 4px;
}
label.field-label {
float: left;
font-weight: bold;
display: inline-block;
margin-left: 40px;
width: :50px;
clear: both;
}
div.quote-detail-section-right {
float: right;
margin-top: 145px;
margin-right: 80px;
width: 35%;
}
<div class="quote-rec-page">
<div class="quote-details">
<label for="section" class="Segment">Quote Details</label>
</div>
<div class="btn-toolbar">
<button type="button">Edit</button>
<button type="button">Delete</button>
<button type="button">Create PDF</button>
<button type="button">Email Quote</button>
<button type="button">Start Sync</button>
</div>
<form>
<div class="quote-detail-section-left">
<div>
<label for="quoteNum" class="field-label">Quote Number</label>
<input type="text" class="quote-input" tabindex="1" id="quoteNumber" />
</div>
<div>
<label for="quoteName" class="field-label">Quote Name</label>
<input type="text" class="quote-input" tabindex="2" id="quoteName" />
</div>
<div>
<label for="oppName" class="field-label">Opportunity Name</label>
<input type="text" class="quote-input" tabindex="3" id="oppName" />
</div>
<div>
<label for="accName" class="field-label">Account Name</label>
<input type="text" class="quote-input" tabindex="4" id="accName" />
</div>
</div>
<div class="quote-detail-section-right">
<div>
<label for="expDate" class="field-label">Expiration Date</label>
<input type="date" class="quote-input" tabindex="5" id="expDate" />
</div>
<div>
<label for="sync" class="field-label">Syncing</label>
<input type="checkbox" class="quote-input" tabindex="6" id="sync" />
</div>
<div>
<label for="status" class="field-label">Status</label>
<input type="text" class="quote-input" tabindex="7" id="status" />
</div>
<div>
<label for="quoteDesc" class="field-label">Description</label>
<input type="text" class="quote-input" tabindex="8" id="quoteDesc" />
</div>
</div>
</form>
</div>
Html/css including apex code:
<apex:page sidebar="false" showHeader="false">
<head>
<title>Quote Details</title>
</head>
<style>
div.btn-toolbar{
position:relative;
top:100px;
left:40%;
width:400px;
}
div.quote-details{
position:relative;
top:122px;
left:250px;
font-weight:bold;
font-size:15px;
}
div.quote-detail-section-left{
float:left;
margin-top : 145px;
margin-left: 100px;
width:35%;
}
input.quote-input{
padding:4px;
}
label.field-label{
float:left;
font-weight:bold;
display:inline-block;
margin-left : 40px;
width::50px;
clear:both;
}
div.quote-detail-section-right{
float:right;
margin-top : 145px;
margin-right: 80px;
width:35%;
}
</style>
<body>
<div class="quote-rec-page">
<div class = "quote-details">
<label for = "section" class="Segment">Quote Details</label>
</div>
<div class ="btn-toolbar">
<button type="button">Edit</button>
<button type="button">Delete</button>
<button type="button">Create PDF</button>
<button type="button">Email Quote</button>
<button type="button">Start Sync</button>
</div>
<form>
<div class ="quote-detail-section-left">
<div>
<label for="quoteNum" class ="field-label">Quote Number</label>
<input type="text" class="quote-input" tabindex="1" id="quoteNumber"/>
</div>
<div>
<label for="quoteName" class ="field-label">Quote Name</label>
<input type="text" class="quote-input" tabindex="2" id="quoteName"/>
</div>
<div>
<label for="oppName" class ="field-label">Opportunity Name</label>
<input type="text" class="quote-input" tabindex="3" id="oppName"/>
</div>
<div>
<label for="accName" class ="field-label">Account Name</label>
<input type="text" class="quote-input" tabindex="4" id="accName"/>
</div>
</div>
<div class ="quote-detail-section-right">
<div>
<label for="expDate" class ="field-label">Expiration Date</label>
<input type="date" class="quote-input" tabindex="5" id="expDate"/>
</div>
<div>
<label for="sync" class ="field-label">Syncing</label>
<input type="checkbox" class="quote-input" tabindex="6" id="sync"/>
</div>
<div>
<label for="status" class ="field-label">Status</label>
<input type="text" class="quote-input" tabindex="7" id="status"/>
</div>
<div>
<label for="quoteDesc" class ="field-label">Description</label>
<input type="text" class="quote-input" tabindex="8" id="quoteDesc"/>
</div>
</div>
</form>
</div>
</body>
</apex:page>

How to align a input form?

I'm not strong in frontend development :) I'm using bootstrap for created a form. But it isn't look fine. How could I align my input form in one column?
<form>
<div class="form-group form-inline">
<label for="exampleInputPrice" class="personal-form-labels">Purchase Price</label>
<input type="text" class="form-control" id="exampleInputPrice" placeholder="$$$">
</div>
<div class="form-group form-inline">
<label for="exampleInputLoan" class="personal-form-labels">Loan Amont</label>
<input type="text" class="form-control" id="exampleInputLoan" placeholder="$$$">
</div>
<div class="col-md-12 text-center block-buttons">
<button type="submit" class="btn btn-primary btn-lg">Continue</button>
</div>
</form>
enter image description here
Use of display:table-*
table {
border-collapse: separate;
}
.form-inline {
display: table-row;
}
.form-inline label, .form-inline input {
display: table-cell;
margin: 0 0 5px 10px;
}
<form>
<div class="form-group form-inline">
<label for="exampleInputPrice" class="personal-form-labels">Purchase Price</label>
<input type="text" class="form-control" id="exampleInputPrice" placeholder="$$$">
</div>
<div class="form-group form-inline">
<label for="exampleInputLoan" class="personal-form-labels">Loan Amont</label>
<input type="text" class="form-control" id="exampleInputLoan" placeholder="$$$">
</div>
<div class="col-md-12 text-center block-buttons">
<button type="submit" class="btn btn-primary btn-lg">Continue</button>
</div>
</form>
Try like this , bootstrap Horizontal form not support in bootstrap -4
Not supported ,use bootstrap 3
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<form class="form-horizontal" action="/action_page.php">
<div class="form-group">
<label class="control-label col-sm-2" for="Purchase Price">Purchase Price</label>
<div class="col-sm-4">
<input type="email" class="form-control" id="exampleInputPrice" placeholder="$$$">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="Loan Amont">Loan Amont</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="exampleInputLoan" placeholder="$$$">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default">Continue</button>
</div>
</div>
</form>
bootsrap-3 doc https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_form_horizontal&stacked=h
If you are using bootstrap 4 Try This :
<form>
<div class="form-group row">
<label for="exampleInputPrice" class="col-sm-2 col-form-label">Purchase Price</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="exampleInputPrice" placeholder="$$$">
</div>
</div>
<div class="form-group row">
<label for="exampleInputLoan" class="col-sm-2 col-form-label">Loan Amont</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="exampleInputLoan" placeholder="$$$">
</div>
</div>
<div class="form-group form-inline">
<button type="submit" class="btn btn-primary btn-lg">Continue</button>
</div>
</form>
https://jsfiddle.net/sv2j08dd/3/
Modulation:
Glass thickness:
css:
.inputs span{ display: inline-block; width: 60%; padding: 0 0 15px 0; }
.inputs span input{ width: 30%; float: left; height:25px;padding: 0 5px;}
.inputs{width: 100%;float: left;padding: 0 25px; box-sizing: border-box;}
.inputs label{width: 20%;float: left;}

Setting height on form and placeholder break

I would like to set the height on this form-group. The problem is that the placeholder can't be more wide that it is now, and therefore I have to make it higher. As it is now the placeholder text is going horizontal out, and I would like the placeholder text continued under the line vertically instead.
Is that possible at all?
<div class="form-group">
<label class="sr-only" for="udfordring">Største udfordring</label>
<input type="text" class="form-control" id="udfordring" name="udfordring" placeholder="This is a long text there cannot be in the normal field" style="height:300px;"/>
</div>
CSS
.navbar .navbar-form
{
padding-top: 0;
padding-bottom: 0;
margin-right: 0;
margin-left: 0;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
HTML
<div class="panel panel-primary shadow">
<div class="panel-heading">SUBSCRIBE FOR NEWSLETTER OF WHOLE 10</div> <!-- id-2 for the subscribe channel-->
<div class="panel-body">
<form>
<div class="form group">
<label for="input e-mail">EMAIL</label>
<input type="email" class="form-control" id="inputEmail" placeholder="email">
</div>
<div class="form group">
<label for="input e-mail">USERNAME</label>
<input type="email" class="form-control" id="inputEmail" placeholder="username">
</div>
<br>
<div class="checkbox">
<label><input type="checkbox">REMEMBER ME</label>
</div>
<button type="submit" class="btn btn-primary">LOGIN</button>
</form>`enter code here`
</div>
</div>

Single Page App - CSS3 width/height 100% not effective because Bootstrap doesn't define static value of body

I'm trying to make a single page web app and I am also using boostrap 3.0. What I am having an issue with is making a div section, ie <div id="nameContainer">, fill up the entire viewport as if it was it's own page. Instead, the next sibling <div id="nameContainer"> will show up on the view port. I thought I could fix this with css position, width, and height attributes but I am not having success. How do I make each <div id="nameContainer"> fill the entire viewport as if it it's own page? I have my own css page load last so my custom CSS override any bootstrap behavior.
EDIT: the width: 100% and height: 100% is ineffective because the body is not defined in static values(non percentage). How do I get this size/assign the size of body so the percentages of the viewport are correct?
section of index.html:
<body class="container">
<div id="lightbox">
<div id="exitButton" type="button" class="btn btn-primary" data-toggle="button">Exit</div>
<div class="well col-lg-8" id="messageBox">
<h3 class="messageBox" >Performing operation...</h3>
</div>
</div>
<div id="lead">
Filler to use as position: absolute
</div>
<div id="shareImageContainer">
<div class="well col-md-3 titleBox">
<div>
<h1>Share Image<br><small>Share image all in one step</small></h1>
</div>
</div>
<form id="shareImageForm">
<div class="form-group btn-group-ls well col-md-5">
<legend>Region</legend>
<input class="form-inline" type="radio" name="region" id="IAD0" value="IAD" checked>
<label for="IAD0" class="btn btn-default region">Virginia</label>
<input class="form-inline" type="radio" name="region" id="ORD0" value="ORD">
<label for="ORD0" class="btn btn-default region">Chicago</label>
<input class="form-inline" type="radio" name="region" id="DFW0" value="DFW">
<label for="DFW0" class="btn btn-default region">Dallas</label>
<input type="radio" id="HKG0" name="region" value="HKG">
<label for="HKG0" class="btn btn-default region">Hong Kong</label>
</div>
<div class="form-group well col-md-5">
<label for="producerUsername">Producer Username</label>
<input type="text" class="form-control" name="producer_username" id="producerUsername" placeholder="Enter producer's username" required>
<label for="producerApiKey">Producer Api Key</label>
<input type="text" class="form-control" name="producer_apikey" id="producerApiKey" placeholder="Enter producer's api key" required>
</div>
<div class="form-group well col-md-5">
<label for="consumerUsername">Consumer Username</label>
<input type="text" class="form-control" name="consumer_username"id="consumerUsername" placeholder="Enter consumer's username" required>
<label for="consumerApiKey">Consumer Api Key</label>
<input type="text" class="form-control" name="consumer_apikey" id="consumerApiKey" placeholder="Enter consumer's api key" required>
</div>
<div class="form-group well col-md-5">
<label for="imageUuid">Image UUID</label>
<input type="text" class="form-control" name="image_uuid" id="imageUuid" placeholder="Enter images's image Uuid" required>
</div>
<div class="col-md-5">
<input type="submit" value="Submit" class="btn btn-primary">
</div>
</form>
</div>
<div id="addMemberContainer">
<div class="well col-md-3 titleBox">
<div>
<h1>Add Member<br><small>Add a member to be shared</small></h1>
</div>
</div>
<form id="addMemberForm">
<div class="form-group btn-group-ls well col-md-5">
<legend>Region</legend>
<input class="form-inline" type="radio" name="region" id="IAD5" value="IAD" checked>
<label for="IAD5" class="btn btn-default region">Virginia</label>
<input class="form-inline" type="radio" name="region" id="ORD5" value="ORD">
<label for="ORD5" class="btn btn-default region">Chicago</label>
<input class="form-inline" type="radio" name="region" id="DFW5" value="DFW">
<label for="DFW5" class="btn btn-default region">Dallas</label>
<input type="radio" id="HKG5" name="region" value="HKG">
<label for="HKG5" class="btn btn-default region">Hong Kong</label>
</div>
<div class="form-group well col-md-5">
<label for="producerUsername">Producer Username</label>
<input type="text" class="form-control" name="producer_username" id="producerUsername" placeholder="Enter producer's username" required>
<label for="producerApiKey">Producer Api Key</label>
<input type="text" class="form-control" name="producer_apikey" id="producerApiKey" placeholder="Enter producer's api key" required>
</div>
<div class="form-group well col-md-5">
<label for="imageUuid">Image UUID</label>
<input type="text" class="form-control" name="image_uuid" id="imageUuid" placeholder="Enter images's image Uuid" required>
</div>
<div class="form-group well col-md-5">
<label for="consumerAddId">Consumer/Member account id number to add</label>
<input type="text" class="form-control" name="consumer_tenantid" id="consumer_tenantid" placeholder="Enter member account id number" required>
</div>
<div class="col-md-5">
<input type="submit" value="Submit" class="btn btn-primary">
</div>
</form>
</div>
CSS:
#lightbox {
display: none;
top: 0px;
left: 0px;
bottom: 0px;
right: 0px;
padding: 100px;
position: fixed;
z-index: 85;
background: rgba(0,0,0,.6);
}
.messageBox {
padding-top: 60px;
text-align: center;
}
body {
overflow: hidden;
width:100%;
height:100%;
}
#lead {
position: absolute;
height: 100%;
width: 100%;
top: 0px;
left: 0px;
}
[id*="Container"] {
position: relative;
height: 100% !important;
width: 100% !important;
top: 0px;
left: 0px;
}
I had to add width and height to html also.
body, html {
width: 100% !important;
height: 100% !important;
}