I'm having issues with my divs appearing outside of their parent div. This only happens when the window is on a computer in full screen mode, but when the screen is made smaller to a phone/tablet size the divs function how they should. In this codepen I used border colours to help distinguish from when the divs are outside of the parent div to when they're inside the parent div. http://codepen.io/MarkBond/pen/LVKPjG?editors=110
fullscreen
phone view
HTML
<div class="ibox-content" id="ibox-9">
<!--DIV BODY-->
<div class="content active" id="budgetSelection">
<div class="col-lg-6">
<label>Budget Scenerio</label>
<div class="checkbox">
<label><input type="checkbox" />50mill</label>
</div>
<div class="checkbox">
<label><input type="checkbox" />100mill</label>
</div>
<label>Table Views</label>
<div class="checkbox">
<label><input type="checkbox" />Table1</label>
</div>
</div>
<div class="col-lg-6">
<div class="radio">
<label><input type="radio" />Show Treatments</label>
</div>
<div class="radio">
<label><input type="radio" />Show Years</label>
</div>
</div>
</div>
</div>
you can give a container-fluid class to your div body.
Bootply Link
<div class="content active container-fluid" id="budgetSelection">
you can also go for clearfix which fixes the problem too.
Your divs are floated on the full screen view, so the parent container needs some sort of clearfix applied to it. You should be able to just add the "clearfix" class if you're using bootstrap.
<div class="content active clearfix" id="budgetSelection" ng-controller="InfoController as infoCtrl">
Give width 100% to class col-lg-6. Currently it is 50% for #media (min-width: 1200px).
.col-lg-6 {
width: 100%;
}
Related
I have a test label in a col-6 div. the text should have the width of the div with col-6 class.
this is how it looks now
how can i make the text inherit the div's width?
<div class="col-md-6">
<div class="form-group">
<div>
<input type="checkbox"/>
<div class="state p-danger">
<div [inlineSVG]="'assets/svg/accept.svg'"></div>
<label>I will also be available to meet during the event so list me with the available resources</label>
</div>
</div>
</div>
</div>
Put white-space: nowrap in your .state.p-danger element. This will make texts getting outside of bounds go the next line instead.
I have my code for #media but it doesn't align well. I hope you can help me align the contents from 320px to 767 for mobile. and 768px to 800px for tablet. Is my html code right? I cant align the contents smoothly :(
html code:
<div class="container-fluid header-subscribe-section">
<div class="container">
<div class="row">
<div class="col-md-7">
<p>
<span class="header-p-latestmenus font-Awesome white">Get our latest games in your inbox.</span>
<span class="header-p-subscribe font-GreatVibes white">Subscribe Now!</span>
</p>
</div>
<div class="col-md-5" id="mobile-enter-email">
<input type="text" name="lname" class="header-textboxemail font-Awesome white" placeholder="Email Address">
<button type="button" class="header-btsubscribe font-GaramondPremierePro">SUBSCRIBE</button>
</div>
</div>
</div>
</div>
CSS code:
.header-subscribe-section {background-color:#ad1f34; height:99.27px; width:100%}
.header-p-latestmenus{font-size:20px; letter-spacing:0.5px;}
.header-p-subscribe{font-size:28px; letter-spacing:0.5px;}
.header-btsubscribe{border-radius:4px; background-color:#831024; color:white; width:134.55px; height:44.19685px; width:146.19685px; border:none;font-size:18px;}
.header-textboxemail{width: 286.779527559px;height: 46.19685px;font-size: 17px;border: 0;}
.header-subscribe-section p{padding: 4% 14%;}
header-subscribe-section: the alignment can be changed for mobile
you can add col-xs-36 to your parents div and usually we set inputs width 100% in smaller screen
change width property in your css file to 100%
ande remove height
How do I make a simple row with a form-control without getting a horizontal scrollbar?
It seems that whatever I do with bootstrap 3, any "fluid" row that should be 100% is actually going beyond its container which introduces a horizontal scrollbar. How do I stop this and make it fit into its container?
Example:
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<input type="text" required="" class="form-control" placeholder="Enter something" id="foo" name="foo">
</div>
</div>
</div>
jsfiddle: http://jsfiddle.net/qnb3q40g
Your code is working fine with bootstrap 3.2.0
DEMO
.container-fluid .row {
margin-left: 0;
margin-right: 0;
}
For some reason when using container-fluid bootstrap doesn't take into account that it is using a negative margin on rows. So by adding the css above it will fix your issue.
Demo -http://jsfiddle.net/MeycD/537/
You can do it in this way also if you want.
<div class="container">
<div class="row">
<div class="col-xs-5 col-lg-1">
<input type="text" class="form-control input-normal" />
</div>
</div>
</div>
My JSP code is
<h:field
path="configuredChannels"
required="true"
code="admin.menu.channels">
<div class="row-fluid"
data-channel-checkboxes="#">
<form:checkboxes
element="div class='span1 checkbox'"
items="${channels}"
path="configuredChannels" />
</div>
</h:field>
However the checkbox items works fine on all other resolutions but the item channel value facebook just overlaps with the next checkbox only on 1024 X 768.
here is the jpeg image.
Here is the resulting client code in HTML
<div class="controls">
<div class="row-fluid" data-channel-checkboxes="#">
<div class='span1 checkbox'>
<input id="configuredChannels1" name="configuredChannels" type="checkbox" value="SMS"/><label for="configuredChannels1">SMS</label>
</div class='span1 checkbox'>
<div class='span1 checkbox'>
<input id="configuredChannels2" name="configuredChannels" type="checkbox" value="Voice"/><label for="configuredChannels2">Voice</label></div class='span1 checkbox'>
<div class='span1 checkbox'><input id="configuredChannels3" name="configuredChannels" type="checkbox" value="Facebook"/><label for="configuredChannels3">Facebook</label></div class='span1 checkbox'>
<div class='span1 checkbox'><input id="configuredChannels4" name="configuredChannels" type="checkbox" value="Twitter"/><label for="configuredChannels4">Twitter</label>
</div class='span1 checkbox'><input type="hidden" name="_configuredChannels" value="on"/></div>
<span class="help-inline">
</span>
</div>
</div>
Latest Images
The problem is that you're using a fluid row grid and give the checkboxes a fluid span width:
<div class="row-fluid" data-channel-checkboxes="#">
<div class='span1 checkbox'>
This means that the row-fluid is always 100% of the width of it's container (whatever that may be in the context of your HTML, and the checkbox divs have the span1 class, which is always 6.382978723404255% of the row-fluid width. (This is defined in Twitter Bootstrap)
When you resize the window the 100% of the row-fluid becomes smaller, and at a certain point it hits the mark where ~6.38% of that is not enough to fit the entire contents of the checkbox.
There is no simple solution for this while maintaining this fluid grid, it's doing exactly what it's supposed to do but you probably didn't intend this. A better solution would probably be to not give the checkboxes a defined width just let them use all the width they need.
Try removing span1 from the checkbox divs, and add this CSS:
.checkbox {
float: left;
}
This means that they will not have the evenly distributed width they used to have, but instead once there is not enough room to show all of them on one line the checkboxes will continue on a new line.
addition
You're setting classes on the closing tag of a div. That is completely useless. Classes (and all other attributes) should only be set on the opening tag (<div>), never on </div>
<body>
<div class="container">
<div class="row">
<div class="offset4 span4">
<h1 class="text-center">Days</h1>
<form method="post" action="proc/days.php" id="jobs">
<div class="input-prepend">
<span class="add-on">Job Count</span>
<input type="text" class="day1">
</div>
<div class="input-prepend">
<span class="add-on">Day Name</span>
<input type="text" class="day2">
</div>
</form>
</div>
</div>
</div>
</body>
is my primary block of code (with all the other stuff striped out). I want to get the input-prepend to take up all the width available in the span4.
Right now, the only tricks I can find end up not working, or being way to large.
Also, I am using the Cosmo Bootswatch theme.
Setting .day1 to 76% width (after padding and borders are considered etc) will fill up your space. Problem would then be that you have another element depending on the .day1 class. So add an id, or example like:
<input type="text" class="day1" id="day1">
and then use #day1 {width:76%;} in your css. You'd most likely need to adjust the width size as your screen width changes though (through media queries).