Setting height on form and placeholder break - html

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>

Related

Placing DIV on the right side of form

I have a div in a form and i want to place the div on the right side of the form and the div must be fixed on the right side with the button. I don't know if this can be done but how can i get this done.
HTML
<form class="form-horizontal" method="post">
<div class="form-group">
<label for="name" class="col-lg-1 control-label"> Name</label>
<div class="col-lg-6">
<input type="text" class="typeahead form-control" id="name" placeholder="Name" name="name" required>
</div>
</div>
<!--i want to move this div to the right side of the form and fixed-->
<div style="background-color:white" class="move-right" id="move-right">
<legend style="text-align: center" >Heading <span></span></legend>
</div>
<div>
<button type="submit" class="btn ">Save</button>
</div>
</form>
</div>
If the content of the right should not overlap the other content you need:
.move-right { float:right; } in the css.
And reorder the html code to place the floating element above the others:
<form class="form-horizontal" method="post">
<div style="background-color:white" class="move-right" id="move-
right">
<legend style="text-align: center" >Heading <span></span></le zgend>
</div>
<div class="form-group">
<label for="name" class="col-lg-1 control-label"> Name</label>
<div class="col-lg-6">
<input type="text" class="typeahead form-control" id="name"
placeholder="Name" name="name" required>
</div>
</div>
<div>
<button type="submit" class="btn ">Save</button>
</div>
</form>
otherwise, if the contents can overlap:
use the .move-right { position: absolute; right: 0px; } and .form-horizontal { position: relative; } css code.

How to move labels from top to left and make the inputs 100% long in a flex form?

In other words, how to get from this:
To something like this:
In other words, from labels on top of the input to labels on the left side of the input while making the input fit the parent's width.
.row {
display: flex
}
.form-group {
display: flex
flex: 1 0 0
flex-direction: column
}
.col-12 {
//
}
.col-6 {
//
}
.col-4 {
//
}
<div class="row">
<div class="form-group">
<label class="col-6">First name</label>
<input class="col-6" type="text" value=""></input>
</div>
<div class="form-group">
<label class="col-6">Last name</label>
<input class="col-6" type="text" value=""></input>
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-4">Message</label>
<input class="col-8" type="text" value=""></input>
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-4">Message</label>
<input class="col-12" type="text" value=""></input>
</div>
<div class="form-group">
<label class="col-4">Message</label>
<input class="col-12" type="text" value=""></input>
</div>
<div class="form-group">
<label class="col-4">Message</label>
<input class="col-12" type="text" value=""></input>
</div>
</div>
You don't need display:flex on your row- declaring it on the form-group is sufficient. Then you add the according flex properties on the child elements (input and label).
Also very important: Always insert ; after each declaration, or you will break the entire rule block.
/* essential rules */
.form-group {
display: flex;
}
label {
flex: 0 0 100px;
}
input {
flex: 1;
}
/* only for style */
.form-group {
margin-bottom:1em;
}
input{
padding:.4em;
border-radius:2px;
border:1px solid #ccc;
}
label {
padding:.4em;
font-family:sans-serif;
}
<div class="row">
<div class="form-group">
<label class="col-6">First name</label>
<input class="col-6" type="text" value="">
</div>
<div class="form-group">
<label class="col-6">Last name</label>
<input class="col-6" type="text" value="">
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-4">Message</label>
<input class="col-8" type="text" value="">
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-4">Message</label>
<input class="col-12" type="text" value="">
</div>
<div class="form-group">
<label class="col-4">Message</label>
<input class="col-12" type="text" value="">
</div>
<div class="form-group">
<label class="col-4">Message</label>
<input class="col-12" type="text" value="">
</div>
</div>
Note: inputs are void elements. They don't take closing tags.

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

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.

Aling a div on right

I have this a contact form and I need to float it at the extreme right of its container. How can i do it? I'm trying with everything but nothing happen. Maybe i have to set different class for columns? This is the code:
HTML
<section id="services" class="section text-center">
<div class="container">
<div class="col-md-6 map">
<!-- Responsive iFrame -->
<div class="Flexible-container">
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2694.5937634214993!2d8.0133807!3d47.5173021!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0000000000000000%3A0x9b610c417aa1ee02!2sZAG+Engineering!5e0!3m2!1sde!2sch!4v1443705863599"></iframe>
</div></div>
<div class="col-md-6 form">
<form class="form-horizontal" role="form" method="post" action="index.php">
<div class="form-group">
<div class="col-sm-10">
<input type="text" class="form-control" id="name" name="name" placeholder="Vorname, Name" value="">
</div>
</div>
<div class="form-group">
<div class="col-sm-10">
<input type="text" class="form-control" id="name" name="name" placeholder="Firma" value="">
</div>
</div>
<div class="form-group">
<div class="col-sm-10">
<input type="email" class="form-control" id="email" name="email" placeholder="E-Mail" value="">
</div>
</div>
<div class="form-group">
<div class="col-sm-10">
<input type="text" class="form-control" id="name" name="name" placeholder="Telefon" value="">
</div>
</div>
<div class="form-group">
<div class="col-sm-10">
<textarea class="form-control" rows="4" name="message" placeholder="Nachricht"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-sm-10 col-sm-offset-2">
<input id="submit" name="submit" type="submit" value="Send" class="btn btn-primary">
</div>
</div>
<div class="form-group">
<div class="col-sm-10 col-sm-offset-2">
<! Will be used to display an alert to the user>
</div>
</div>
</form></div>
</div>
<!--/.container -->
</section>
CSS
.col-md-6.map { margin-left: -15px; }
.form-horizontal { width: 100%; float: right; }
.form-group { margin-bottom: -25px; }
.col-md-6.form { border: 1px solid red !important; }
Add col-md-offset-2
<div class="form-group">
// place col-md-offset-2 here for each input
<div class="col-sm-10 col-md-offset-2">
<input type="text" class="form-control" id="name" name="name" placeholder="Vorname, Name" value="">
</div>
</div>
inside form-group either change col-sm-10 to col-sm-12 that will make your input fields take entire width of your form or if yo want them right aligned give float:right to your col-sm-10 div it will work
Not sure what you really want, but if you want the whole form being at the extrem right of the screen, you have to remove the fixed width of your div class="container" which is the reason you have white space on right side.
If you want input being on the right side of your red-bordered area, you should put "float:right" on the col-sm-10" class. Hope it helped you

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;
}