Bootstrap formatting is not making sense - html

I'm VERY new to boot strap. So I figured I would setup a small "form" to see if I could get it to flow and I did an absolute horrible job. I am trying to get things to group into 2's and no more than 5 text boxes per row even in the largest of settings. When I try to set it properly I get TONS of space between the left and right columns.
I tried setting the header but this wrapped strangely and when I tried doing text boxes I got TONS of space between the two columns
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<h3>Quick Survey for Professional Research!</h3>
</div>
. I ended up getting something kind of close using
<div class="row">
<div class="input-group text-center">
<input type="text" />
<input type="text" />
<input type="text" />
<input type="text" />
<input type="text" />
</div>
</div>
But that doesn't seem like its the proper way to handle groups of text boxes and it certainly doesn't get me my grouping that I was looking for. I have set a mockup in jsfiddle from my ASP.net code and it can be found at https://jsfiddle.net/5ckoapng/9/
Any help would be greatly appreciated in understanding what i'm missing here. I'm sure its really stupid but I've spent about 2 hours researching different forms or formatting and couldn't figure this out.

Bootstrap is mobile first - if an element is going to span 12 columns on all resolutions then all you need is the single class:
<div class="container">
<div class="row">
<div class="col-xs-12">
<h3>Quick Survey for Professional Research!</h3>
</div>
</div>
</div>
To show form elements in groups of 2, then you need to nest columns: http://getbootstrap.com/css/#grid-nesting
For example:
<div class="container">
<div class="row">
<div class="col-xs-12">
<form>
<div class="row">
<div class="col-xs-6">
#form input
</div>
<div class="col-xs-6">
#form input
</div>
</div>
</form>
</div>
</div>
</div>
That way there will be 2x 50% (col-xs-6) width columns nested within the main 100% (col-xs-12) column. I have not added form styling or classes, as these are all readily available in the documentation: http://getbootstrap.com/css/#forms
If you wish to use 5 nested columns, then you can utilise the offset class to push 5x col-xs-2 columns over by 1 so they appear to be centred within the main col-xs-12 column: http://getbootstrap.com/css/#grid-offsetting

Related

2 text inputs fill the whole width not working

<div class="row mb-3">
<div class="col-6">
<form autocomplete="off" action="/action_page.php">
<div class="autocomplete" >
<input type="text" id="startLocation" class="form-control" placeholder="von Bahnhof / Haltestelle / Adresse" tabindex="-1">
</div>
</form>
</div>
<div class="col-6">
<input type="text"id="destination" class="form-control" placeholder="nach Bahnhof / Haltestelle / Adresse" tabindex="-1">
</div>
</div>
I want my two text inputs to be the same with and toghther fill the total width. The Problem is the "startLocation does not have the correct width. I think its because its nested inside another element but I need the other element to have the class autocompleted so I don't know how to fix this.
Sorry If this is a stupid beginner question. Im new to html and bootstrap.
What is the "mb-3" class for in row?
Did you mean md-3? Which you would only need to set column widths (if you're using bootstrap).
Open the developer tools and check the padding and margin around the form. The form itself, and the nested div are probably taking up some space. Also the inputs have different parents so your styling might not be targeting the right selector.

How to display complete text when using bootstrap columns?

I have bootstrap columns that has two labels and two inputs From and To, So From input is showing text correct but To input is not showing complete text when i load data dynamically.How can i fix this issue using bootstrap or I have to use css helper class to make it work.
when we use low resolution monitors problems occurs most of the time e.g 1366 x 768
main.html
<div class="col-md-6 fieldHeight">
<div class="form-group">
<label for="issueFromDate" class="col-md-5">Issue Date
Range:</label>
<div class="col-md-7">
<div class="row">
<div class="col-md-5 changeWdh">
<input type="text" class="form-control"
ng-model="riskAssessmentDTO.issueFromDate"
name="issueFromDate" id="issueFromDate" disabled />
</div>
<div class="col-md-1">
<label class="control-label padd15"> To:</label>
</div>
<div class="col-md-5 changeWdh">
<input type="text" class="form-control"
ng-model="riskAssessmentDTO.issueToDate" name="issueToDate"
id="issueToDate" disabled />
</div>
</div>
</div>
</div>
</div>
I suggest you read more into the bootstrap grid system. You could use a mix of the different col- classes in order to make sure everything fits on the screen depending on the resolution. See this example:
Zoom and unzoom to see the grid system in action
Also, a date field always contains a maximum amount of characters. Therefore, you could set a min-width to the input

HTML Coding custom button for "mailto"

So I have started using Foundation. Very nice indeed.
And I am using Foundation's custom "Radius Button", to make a "mailto:" form.
Basically, all I can find online are the ugly default HTML buttons/labels.
Is there a way I can use this button and Foundation's "Input Label's" to create a "mailto:" form?
Here is the source code for the buttons/labels all sorted out:
<div class="row">
<div class="large-12 columns">
<div class="panel">
<h3>Survey</h3>
<p>I'm looking into what to create, but need ideas!
Anything will help, and the time it takes you to fill one out, is nothing!</p>
<div class="row">
<div class="large-4 medium-4 columns">
<label>Email (Optional)</label>
<input type="text" placeholder="Email" />
</div>
<div class="large-4 medium-4 columns">
<label>Idea Subject (What's it about?)</label>
<input type="text" placeholder="Subject" />
</div>
</div>
<div class="row">
<div class="large-12 columns">
<label>What is your idea?</label>
<textarea placeholder="Idea"></textarea>
</div>
</div>
<div class="row">
<div class="large-4 medium-4 small-4 columns">
Send
Reset
</div>
</div>
</div>
</div>
</div>
I have never used Foundation before, but I assume, that unless you know the answer just by code, you could implement this into a pre-made Foundation "project".
But anyway, here is what the above HTML looks like when previewed:
See the Send & Reset? That's what I want to use to submit it and send it to me.
Thanks for any given help.
You have to use Javascript if you want to output what people have entered in a textbox. You can use these variables in your mailto:
&cc = to set the CC recipient(s)
&bcc = to set the BCC recipient(s)
&subject = to set the email subject, URL encode for longer sentences, so replace spaces with %20, etc.
&body = to set the body of the message, you can add entire sentences here, including line breaks. Line breaks should be converted to %0A.
So a link should look like this:
mail link

How to make form element share a bootstrap column with another element

Multiple places in my code I need to position this element (a globe glyph) directly to the right of a textbox, almost touching it. You could do this by doing the following
<div class="col-md-3">
<input class="form-control" id="CustomTaskTitle" name="CustomTaskTitle" type="text" />
</div>
<div class="col-md-1">
<span class="glyphicon glyphicon-globe pull-left"></span>
</div>
but then you waste and entire column. Any solutions?
**You will have to expand the jFiddle output window to max size to get the row layout
Heres my JFiddle - http://jsfiddle.net/5Rhzh/
You'll notice the glyph automatically goes beneath the textbox because there is no room in the column.
Bootstrap already has this. Its a component called input groups.
The correct way to do it would be
<div class="col-md-3">
<div class="input-group">
<input class="form-control" id="CustomTaskTitle" name="CustomTaskTitle" type="text" >
<span class="glyphicon glyphicon-globe pull-left"></span>
</div>
</div>
And there you have space for another 3 columns

Aligning the logo with the input fields on ASP.NET MVC 4 using Bootstrap

Im designing a website using Visual Studio 2012 ASP.NET MVC4
And it’s supposed to be like this
but it turned out to be like this
![default2][2]
I need to align the logo with the Username & Password fields and those fields should have space in between. Btw, I'm using the latest version of Twitter Bootstrap as my CSS. Thanks for helping out!
Also, these are my codes.
<header class="navbar navbar-inverse" role="banner">
<div class="container">
<img src="#Url.Content("~/Content/img/Logo-Sample.png")" alt="Image" id="logo" class="img-responsive"/>
<div class="pull-right">
<form class="navbar-form pull-right" role="form">
<div class="form-group">
<input type="email" class="form-control" id="exampleInputEmail2" placeholder="Username">
</div>
<div class="form-group">
<input type="password" class="form-control" id="exampleInputPassword2" placeholder="Password">
</div>
<div class="checkbox">
<label>
<input type="checkbox"> Remember me
</label>
</div>
<button type="submit" class="btn btn-default">Sign in</button>
</form>
</div>
</div>
</header>
Update:
I've applied Ryan's suggestion the "float stuff" and the logo is now inlined with the input fields.
But the input field went upward instead of downward. Any suggestions for this? Thanks!
Check out Bootstrap's docs for Inline forms. I believe this is exactly what you are looking for.
As a side note, check out TwitterBootstrapMVC. Your code might look cleaner with it.
So it looks like your logo and login sections are both block-level elements. They need to be inline-block OR one of them needs to be floated left or right as appropriate.
Insofar as the space between elements for your login block... I'd do a css selector to match the header login input elements and add some margin-right to them.
HTML formatting is very finicky sometimes. However, open up the markup for the asp file and put a space between those input areas' tags or put one trailing after the word in the placeholder. For the being slightly too high, I forgot the word I am looking for, but its something a bit like a table, make them both in slots for that row. Look around for what Im attempting to say as I just completely forgot the term.
(if I remember Ill come back and edit this)