I am developing the follow page:
The problem i'm having is the tabular structure. The outer div, my container is not expanding with the alternating heights of the tabs. See image of problem:
I would like the container to extend to the tabs heights.
HTML:
<section class="x_section_wide">
<div id="ambition_container">
<div id="x_tools">
<span id="a_name">name</span>
</div>
<div class="x_content">
</div>
<div id="a_progress_bar">
<span id="a_progress">
</span>
</div>
<div class="tabs">
<div class="tab">
<input type="radio" id="tab-4" name="tab-group-2" checked>
<label for="tab-4" id="a_tab_one">1</label>
<div id="tab_information" class="tab_content">
<div id="a_extra_info">
<div id="a_extra_info_inner">
<div>1</div>
<div>1</div>
<div>1</div>
<div>1</div>
<div>1</div>
<div>1</div>
<div>1</div>
<div>1</div>
</div>
</div>
</div>
</div>
<div class="tab">
<input type="radio" id="tab-5" name="tab-group-2">
<label for="tab-5" id="a_tab_two">2</label>
<div id="tab_evidence" class="tab_content">
<div id="a_evidence">
<div id="a_evidence_inner">
2
</div>
</div>
</div>
</div>
<div class="tab">
<input type="radio" id="tab-6" name="tab-group-2">
<label for="tab-6" id="a_tab_three">3</label>
<div id="tab_comments"class="tab_content">
<div id="a_comments">
<div id="a_comments_inner">
<p>3</p><br/>
<p>3</p><br/>
<p>3</p><br/>
<p>3</p><br/>
<p>3</p><br/>
<p>3</p><br/>
<p>3</p><br/>
<p>3</p><br/>
<p>3</p><br/>
<p>3</p><br/>
<p>3</p><br/>
<p>3</p><br/>
<p>3</p><br/>
<p>3</p><br/>
<p>3</p><br/>
</div>
</div>
</div>
</div>
<div class="tab">
<input type="radio" id="tab-7" name="tab-group-2">
<label for="tab-7" id="a_tab_four">4</label>
<div id="tab_supporters" class="tab_content">
<div id="a_supporters">
<div id="a_supporters_inner">
4
</div>
</div>
</div>
</div>
</div>
</div>
</div>
The CSS used for this particular page is:
#a_extra_info, #a_evidence, #a_comments, #a_supporters{
padding:30px;
}
#a_extra_info{
background-color: #E29FA4;
}
#a_evidence{
background-color: #B98489;
}
#a_comments{
background-color: #845F64;
}
#a_supporters{
background-color: #5E4549;
}
#a_extra_info_inner, #a_evidence_inner, #a_comments_inner, #a_supporters_inner{
background-color: #FFF;
/*padding: 10px;*/
}
#a_extra_info_inner span, #a_extra_info_inner label, #a_evidence_inner span, #a_evidence_inner label, #a_comments_inner span, #a_comments_inner label, #a_supporters_inner span, #a_supporters_inner label{
color: #000;
}
.tabs {
position: relative;
min-height: 276px; /* This part sucks */
clear: both;
}
.tab {
float:left;
width: 25%;
}
.tab > label {
text-align: center;
position: relative;
height:30px;
line-height: 30px;
font-weight: normal;
font-size: 100%;
cursor: pointer;
margin:0;
}
.tab [type=radio] {
display: none;
}
.tab_content {
position: absolute;
top: 28px;
left: 0;
right: 0;
bottom: 0;
}
[type=radio]:checked ~ label {
z-index: 2;
}
[type=radio]:checked ~ label ~ .tab_content {
z-index: 1;
}
#a_tab_one{
background-color: #E29FA4;
color:#000;
}
#a_tab_two{
background-color: #B98489;
color:#000;
}
#a_tab_three{
background-color: #845F64;
}
#a_tab_four{
background-color: #5E4549;
}
Is there a solution for this? Please see the link for a better view of the problem.
Thanks
set this style on your outer div id or class whatever you have
#ambition_container{
background-color: #461f20;
padding:20px 10px 10px 10px;
position:relative;
height:100%;
overflow-y:auto;
display:block
}
you must change like this
for tabs
<div class="tabs">
<div class="tab">
<div class="tab">
<div class="tab">
<div class="tab">
</div>
css of tabs
.tabs {
clear: both;
height: 30px;
position: relative;
}
and place content after tabs in content div
<div class="content" style="">
<div id="tab_information for tab1" class="tab_content" style="display: block;">
<div id="a_extra_info">
<div id="a_extra_info_inner">Place Content of tab 1</div>
</div>
</div>
<div id="tab_information for tab2" class="tab_content" style="display: none;">
<div id="a_extra_info">
<div id="a_extra_info_inner">Place Content of tab 2</div>
</div>
</div>
</div>
#ambition_container, #tabs{
overflow:hidden;
}
Add this rules on your CSS stuff.
Related
I had encountered to an interesting CSS challenge. In the following code I was able to vertically aligned the text and input. The part I couldn't manage was, without breaking the vertical alignment (text - input) I need to put footer text under the input.
.container {
width: 300px;
}
.head {
display: inline-block;
vertical-align: middle;
width: 20%;
}
.col {
display: inline-block;
vertical-align: middle;
}
.col input {
width: 100px;
}
<div class="container">
<div class="head">
Text
</div>
<div class="col">
<input type="text" />
</div>
<div class="col">
<input type="text" />
</div>
<div class="head"></div>
<div class="col">
Footer Text
</div>
</div>
<div class="container">
<div class="head">
Three Line Text
</div>
<div class="col">
<input type="text" />
</div>
<div class="col">
<input type="text" />
</div>
<div class="head"></div>
<div class="col">
Footer Text
</div>
</div>
Also, container div height should effect from footer text as well. So using absolute will not work for this case.
I already aware some JavaScript or CSS hack solutions. But for this case, I want to proceed with a proper way. How can we achieve this properly?
UPDATE
I forgot to mention before. Footer text could be multiple lines as well. It should cover both inputs underneath.
Flexbox can do that but it requires restructuring the HTML and altering a class or two...oh, and a pseudo-element.
.container {
width: 300px;
display: flex;
margin: 1em;
border: 1px solid red;
}
.head {
width: 20%;
display: flex;
flex-direction: column;
justify-content: center;
}
.col,
.second {
display: flex;
flex-direction: column;
justify-content: center;
margin: 0 .25em;
}
input {
width: 100px;
}
.col:before {
content: "";
height: 1.2em; /* or whatever your line-height is */
}
<div class="container">
<div class="head">
Text
</div>
<div class="col">
<input type="text" />
<div class="foot">
Footer Text
</div>
</div>
<div class="second">
<input type="text" />
</div>
</div>
<div class="container">
<div class="head">
Three Line Text
</div>
<div class="col">
<input type="text" />
<div class="foot">
Footer Text
</div>
</div>
<div class="second">
<input type="text" />
</div>
</div>
This question already has answers here:
Percentage Height HTML 5/CSS
(7 answers)
Closed 4 years ago.
I'm trying to get 2 divs to appear side by side in their parent and to both vertically fill the parent. I've tried setting height and min-height to 100% but I don't understand why its not working.
Here is my html:
<div class="calc-wrap clear">
<h2>Title</h2>
<div class="calc-content clear">
<div class="calc-form">
<form id="cost_calculator">
<fieldset>
<legend>
<h3>Find out how much your stuff costs you</h3>
</legend>
<ol>
<li class="one">
<label for="cost_of_pack">quantity</label>
<span class="pound-label">£</span>
<input type="number" id="cost_of_pack" name="cost_of_pack" value="0.0" min="0" step="0.10">
</li>
<li class="two">
<label for="quantity_smoked">How many per day?</label>
<input type="number" id="quantity_smoked" name="quantity_smoked" value="0">
</li>
</ol>
</fieldset>
</form>
</div>
<div class="calc-save">
<div class="calc-results-content clear">
<h3>Results</h3>
<div class="calc-results">
<div>
<p id="weekly_cost">£<span>0.00</span> per week</p>
<p id="monthly_cost">£<span>0.00</span> per month</p>
<p id="annual_cost" class="noborder">£<span>0.00</span> per year</p>
</div>
</div>
<div class="calc-quitnow">
<p>Well done</p>
</div>
</div>
</div>
</div>
</div>
And CSS:
.calc-content {
display: inline-block;
border: 3px solid blue;
width: 100%;
border-color: #87B7CD;
}
.calc-form,
.calc-save {
height:100%;
border: 1px solid red;
float: left;
}
.calc-form {
width: 60%;
}
.calc-save {
width: 39%;
background-color: #87B7CD;
}
.calc-results {
float: left;
width: 60%;
}
And a JS Fiddle
Any help would be much appreciated.
You can use "the Flex powers"! ;)
.calc-content {
display: flex;
/*display: inline-block;*/
border: 3px solid blue;
width: 100%;
border-color: #87B7CD;
}
.calc-form,
.calc-save {
border: 1px solid red;
/*float: left;*/
}
.calc-form {
width: 60%;
}
.calc-save {
width: 39%;
background-color: #87B7CD;
}
.calc-results {
float: left;
width: 60%;
}
<div class="calc-wrap clear">
<h2>Title</h2>
<div class="calc-content clear">
<div class="calc-form">
<form id="cost_calculator">
<fieldset>
<legend>
<h3>Find out how much your stuff costs you</h3>
</legend>
<ol>
<li class="one">
<label for="cost_of_pack">quantity</label>
<span class="pound-label">£</span>
<input type="number" id="cost_of_pack" name="cost_of_pack" value="0.0" min="0" step="0.10">
</li>
<li class="two">
<label for="quantity_smoked">How many per day?</label>
<input type="number" id="quantity_smoked" name="quantity_smoked" value="0">
</li>
</ol>
</fieldset>
</form>
</div>
<div class="calc-save">
<div class="calc-results-content clear">
<h3>Results</h3>
<div class="calc-results">
<div>
<p id="weekly_cost">£<span>0.00</span> per week</p>
<p id="monthly_cost">£<span>0.00</span> per month</p>
<p id="annual_cost" class="noborder">£<span>0.00</span> per year</p>
</div>
</div>
<div class="calc-quitnow">
<p>Well done</p>
</div>
</div>
</div>
</div>
</div>
This is because the parent <div> has no defined height, so obviously, the children elements can't fill 100% of the parents' height.
Add a height to your parent's class calc-content, e.g. height: 200px;.
calc-content {
display: inline-block;
border: 3px solid blue;
width: 100%;
height: 200px;
border-color: #87B7CD;
}
One way is to use display: flex or display: inline-flex in your .calc-content rule.
Use display: flex on calc-content and keep the form element inside the fieldset element like shown below. Also need for float left now.
.calc-content {
display: flex;
border: 3px solid blue;
width: 100%;
border-color: #87B7CD;
}
.calc-form,
.calc-save {
height: 100%;
border: 1px solid red;
}
.calc-form {
width: 60%;
}
fieldset {
width: 60%;
}
.calc-save {
width: 40%;
background-color: #87B7CD;
}
.calc-results {
float: left;
width: 60%;
}
<div class="calc-wrap clear">
<h2>Title</h2>
<div class="calc-content ">
<fieldset>
<legend>
<h3>Find out how much your stuff costs you</h3>
</legend>
<form id="cost_calculator">
<ol>
<li class="one">
<label for="cost_of_pack">quantity</label>
<span class="pound-label">£</span>
<input type="number" id="cost_of_pack" name="cost_of_pack" value="0.0" min="0" step="0.10">
</li>
<li class="two">
<label for="quantity_smoked">How many per day?</label>
<input type="number" id="quantity_smoked" name="quantity_smoked" value="0">
</li>
</ol>
</form>
</fieldset>
<div class="calc-save">
<div class="calc-results-content clear">
<h3>Results</h3>
<div class="calc-results">
<div>
<p id="weekly_cost">£<span>0.00</span> per week</p>
<p id="monthly_cost">£<span>0.00</span> per month</p>
<p id="annual_cost" class="noborder">£<span>0.00</span> per year</p>
</div>
</div>
<div class="calc-quitnow">
<p>Well done</p>
</div>
</div>
</div>
</div>
</div>
Are you trying to do like this:
Removed height from .calc-form, .calc-save & modified .calc-content with
display: flex;
.calc-content {
display: flex;
border: 3px solid blue;
width: 100%;
border-color: #87B7CD;
}
.calc-form,
.calc-save {
border: 1px solid red;
float: left;
}
.calc-form {
width: 60%;
}
.calc-save {
width: 39%;
background-color: #87B7CD;
}
.calc-results {
float: left;
width: 60%;
}
<div class="calc-wrap clear">
<h2>Title</h2>
<div class="calc-content clear">
<div class="calc-form">
<form id="cost_calculator">
<fieldset>
<legend>
<h3>Find out how much your stuff costs you</h3>
</legend>
<ol>
<li class="one">
<label for="cost_of_pack">quantity</label>
<span class="pound-label">£</span>
<input type="number" id="cost_of_pack" name="cost_of_pack" value="0.0" min="0" step="0.10">
</li>
<li class="two">
<label for="quantity_smoked">How many per day?</label>
<input type="number" id="quantity_smoked" name="quantity_smoked" value="0">
</li>
</ol>
</fieldset>
</form>
</div>
<div class="calc-save">
<div class="calc-results-content clear">
<h3>Results</h3>
<div class="calc-results">
<div>
<p id="weekly_cost">£<span>0.00</span> per week</p>
<p id="monthly_cost">£<span>0.00</span> per month</p>
<p id="annual_cost" class="noborder">£<span>0.00</span> per year</p>
</div>
</div>
<div class="calc-quitnow">
<p>Well done</p>
</div>
</div>
</div>
</div>
</div>
.parentDiv {
height: 250px;
background: black;
display:flex;
}
.childDiv {
width:50%;
background: grey;
padding:10px;
border:1px solid black
}
<div class="parentDiv">
<div class="childDiv">
text1
</div>
<div class="childDiv">
text2
</div>
</div>
I am trying to build a simple survey with 10 questions which are stored in my database, looped through and the 10 questions are added to the page dynamically. Basically, I would like there to only be one question on the page at a time, but the page to be scrollable to see the other questions.
For example, question 1 would show up in the middle of the page, the user types their answer and clicks next, and the page scrolls to the next question. If the user scrolls up, it scrolls through the page up, and down scrolls down. For jumping to the next question I was planning on just having each question with an id and the next button just having a link to that id.
My HTML for populating the questions on the page looks like this:
<div class="container">
<div class="row wrapper">
<div class="question">
<p>What is your name?</p>
</div>
<div class="description">
<p>Used for...</p>
</div>
<div class="answer">
<input type="text" placeholder="">
</div>
</div>
</div>
My CSS for the above looks like this:
.question {
color: #232A33;
text-align: left;
font-size: 2em;
}
.description {
color: #FFCD3D;
text-align: left;
font-size: 1.25em;
}
.answer {
color: #232A33;
text-align: left;
font-size: 1.25em;
}
I managed to get the question centered on the page using the following code:
.wrapper {
width: 500px;
height: 150px;
position: absolute;
top:0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}
This works fine for one question, but if there are multiple questions they all overlap each other because the position is absolute.
Any tips on how I can achieve this design for the page?
Thanks in advance!
You're very close. This can be done by adding just a tad more css in (adjusting the row class slightly).
If you add the following:
.row {
width: 100%;
margin: 15% auto;
height: 100vh!important;
}
and adjust your wrapper to **relative** positioning, you should see a good result
.wrapper {
width: 500px;
height: auto;
position: relative;
}
See snippet or fiddle
.question {
color: #232A33;
text-align: left;
font-size: 2em;
}
.description {
color: #FFCD3D;
text-align: left;
font-size: 1.25em;
}
.answer {
color: #232A33;
text-align: left;
font-size: 1.25em;
}
.row {
width: 100%;
margin: 15% auto;
height: 100vh!important;
}
.wrapper {
width: 500px;
height: auto;
position: relative;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row wrapper">
<div class="question">
<p>What is your name?</p>
</div>
<div class="description">
<p>Used for...</p>
</div>
<div class="answer">
<input type="text" placeholder="">
</div>
</div>
</div>
<div class="container">
<div class="row wrapper">
<div class="question">
<p>What is your name?</p>
</div>
<div class="description">
<p>Used for...</p>
</div>
<div class="answer">
<input type="text" placeholder="">
</div>
</div>
</div>
<div class="container">
<div class="row wrapper">
<div class="question">
<p>What is your name?</p>
</div>
<div class="description">
<p>Used for...</p>
</div>
<div class="answer">
<input type="text" placeholder="">
</div>
</div>
</div>
<div class="container">
<div class="row wrapper">
<div class="question">
<p>What is your name?</p>
</div>
<div class="description">
<p>Used for...</p>
</div>
<div class="answer">
<input type="text" placeholder="">
</div>
</div>
</div>
This page has questions on the left, and radio buttons for ranking/scale answers on the right. It's designed so that if the question text is too long too fit in the left pane it just keeps going and pushes the radio buttons down a line beneath the question text. I emphasized if because I want to keep it that way, so it only moves if the text is long, I don't want to set something fixed so that every question does the same thing.
The problem is, the N/A radio button doesn't adjust like the other radio buttons. Is there a way to force it to move down with the others? I've tried surrounding the two sections with a div with vertical align bottom but that didn't work. Maybe I am doing something wrong but whatever I've read with regards to vertically aligning inner divs doesn't seem to accomplish this. Is it possible to fix this?
https://jsfiddle.net/x5y49d0n/
.qg {
width: 700px; /* this is only to demonstrate a smaller screen */
padding-top: 10px;
margin-top: 0;
}
.qg-row {
margin-left: 10px;
margin-bottom: 10px;
overflow: auto;
}
.qg-head {
padding-top: 5px;
padding-bottom: 5px;
background-color: #fcfcfc;
}
[class*="qg-guide"] {
font-size: 11px;
min-height: 10px;
text-align: center;
float: left;
}
[class*="qg-right-section"] {
float: right;
width: 500px;
}
.qg-right-section-1 {
width: 60px;
}
.qg-right-section-5 {
width: 300px;
}
[class*="qg-guide-"] {
word-wrap: break-word;
}
.qg-guide-1 {
empty-cells: hide;
width: 100%;
min-width: 100%;
}
.qg-guide-5 {
/* replicate in mobile */
empty-cells: show;
width: 20%;
min-width: 20%;
}
.qg-guide-7 {
empty-cells: show;
width: 14.28%;
min-width: 14.28%;
}
.qg-label {
font-size: 13px;
float: left;
margin-bottom: 10px;
}
[class*="qg-input"] {
font-size: 11px;
width: 60px;
text-align: center;
float: left;
}
<div class="qg">
<div class="qg-table">
<div class="qg-row qg-head">
<div class="qg-guide-label"></div>
<div class="qg-guide qg-right-section-1">
<div class="qg-guide-1"> </div>
</div>
<div class="qg-guide qg-right-section-5">
<div class="qg-guide-7">High7</div>
<div class="qg-guide-7"></div>
<div class="qg-guide-7"></div>
<div class="qg-guide-7">Neutral4</div>
<div class="qg-guide-7"></div>
<div class="qg-guide-7"></div>
<div class="qg-guide-7">Low1</div>
</div>
</div>
<div class="qg-row">
<div class="qg-label">Far far away, behind the word mountains, far from the countries Vokalia and Consonantia.</div>
<div class="qg-guide qg-right-section-1">
<div class="qg-input-1">
<input type="radio" name="0LoMVa" value=""><br>
N/A<br>
</div>
</div>
<div class="qg-right-section-5">
<div class="qg-input-5"><input type="radio" name="0LoMVa" value="5"><br>5<br></div>
<div class="qg-input-5"><input type="radio" name="0LoMVa" value="4"><br>4<br></div>
<div class="qg-input-5"><input type="radio" name="0LoMVa" value="3"><br>3<br></div>
<div class="qg-input-5"><input type="radio" name="0LoMVa" value="2"><br>2<br></div>
<div class="qg-input-5"><input type="radio" name="0LoMVa" value="1"><br>1<br></div>
</div>
</div>
</div>
</div>
<div class="qg">
<div class="qg-table">
<div class="qg-row qg-head">
<div class="qg-guide-label"></div>
<div class="qg-guide qg-right-section-1">
<div class="qg-guide-1"> </div>
</div>
<div class="qg-guide qg-right-section-5">
<div class="qg-guide-5 qg-guide-item-0">High0</div>
<div class="qg-guide-5 qg-guide-item-1"></div>
<div class="qg-guide-5 qg-guide-item-2">Neutral2</div>
<div class="qg-guide-5 qg-guide-item-3"></div>
<div class="qg-guide-5 qg-guide-item-4">Low4</div>
</div>
</div>
<div class="qg-row">
<div class="qg-label">Far far away, behind the word mountains.</div>
<div class="qg-guide qg-right-section-1">
<div class="qg-input-1">
<input type="radio" name="W1MkXk" value=""><br>
N/A<br>
</div>
</div>
<div class="qg-right-section-5">
<div class="qg-input-5"><input type="radio" name="W1MkXk" value="5"><br>5<br></div>
<div class="qg-input-5"><input type="radio" name="W1MkXk" value="4"><br>4<br></div>
<div class="qg-input-5"><input type="radio" name="W1MkXk" value="3"><br>3<br></div>
<div class="qg-input-5"><input type="radio" name="W1MkXk" value="2"><br>2<br></div>
<div class="qg-input-5"><input type="radio" name="W1MkXk" value="1"><br>1<br></div>
</div>
</div>
</div>
</div>
This is what I want it to do:
Also, these questions are created programmatically using a template, so the divs used have to be the same, IOW I can't add a div (with an additional class) to the 1st question that fixes the issue without the 2nd question having the same div. This is the critical requirement which is making it difficult for me to find a solution. Can this be solved?
Is it possible to change DOM structure?? If yes then just try pushing
<div class="qg-guide qg-right-section-1"></div> inside
<div class="qg-guide qg-right-section-5">
code
<div class="qg-row qg-head">
<div class="qg-guide-label"></div>
<div class="qg-guide qg-right-section-5">
<div class="qg-guide-5 qg-guide-item-0">High0</div>
<div class="qg-guide-5 qg-guide-item-1"></div>
<div class="qg-guide-5 qg-guide-item-2">Neutral2</div>
<div class="qg-guide-5 qg-guide-item-3"></div>
<div class="qg-guide-5 qg-guide-item-4">Low4</div>
<div class="qg-guide qg-right-section-1">
<div class="qg-guide-1"> </div>
</div>
</div>
</div>
and change css
.qg-right-section-5 {
width: 360px;
}
.qg-right-section-1 {
width: 60px;
float: left;
}
You can achieve the effect you want by adding a clear-fix after the .qg-label class. I did this in the fiddle by manually inserting an empty <div> with the style clear:both;. You could instead use the clear-fix class of your favorite library or create you own such as:
(This is a classic clearfix example from this answer)
.clearfix:after {
content: " "; /* Older browser do not support empty content */
visibility: hidden;
display: block;
height: 0;
clear: both;
}
Another solution is to include all radio buttons in the same parent element, give it a fixed width, and add float:right; to it and the radio element children. This should be a simple fix. I showed this in comparison to your original fiddle here - fiddle.
Wrong:
Correct:
How to achieve that (without spaces between elements) ? They also must be centered.
HTML:
<div class="header container">
<div class="col col-1">
<input type="text" class="text small" name="search" placeholder="Search suppliers">
</div>
<div class="col col-2">
<div class="styled-select">
<select>
<option>asd</option>
</select>
</div>
</div>
<div class="col col-3">
Reset
Search
</div>
</div>
CSS:
.header {
display: table;
width: 100%;
height: 120px;
text-align: center;
}
.header > div {
display: table-cell;
vertical-align:middle;
}
.col {
width:20%;
}
Anyone can help with that ?
Simply set all div.col with inline-block positioning and set 'text-align:center' on your container to center it horizontally.
.container {
text-align:center;
}
.container .col {
display:inline-block;
}
Use display: inline-block.
.header {
width: 100%;
height:120px;
text-align:center;
}
.col {
display: inline-block;
vertical-align:middle;
}
Also, to remove spaces between each .col, make sure that there is no white space between each opening and closing div tag.
<div class="header container">
<div class="col col-1">
<input type="text" class="text small" name="search" placeholder="Search suppliers">
</div><div class="col col-2"> <!-- THIS LINE - no white-space -->
<div class="styled-select">
<select>
<option>asd</option>
</select>
</div>
</div><div class="col col-3"> <!-- THIS LINE - no white-space also -->
Reset
Search
</div>
</div>
</div>
To get exactly what you want, you'll need an extra HTML wrapper.
http://jsfiddle.net/h37J4/
.header {
width: 100%;
height:120px;
}
.header > .row {
max-width: 360px;
margin: 0 auto;
overflow: hidden; /*quick cleafix hack */
}
.col {
float: left;
}
yoou need a wrapper for the content like this:
<div class="header container">
<div class="wrapper">
<div class="col col-1">
<input type="text" class="text small" name="search" placeholder="Search suppliers">
</div>
<div class="col col-2">
<div class="styled-select">
<select>
<option>asd</option>
</select>
</div>
</div>
<div class="col col-3">
Reset
Search
</div>
<div class="wrapper">
</div>
And then style the wrapper with css, something like this:
.header .wrapper {
width: 70%; /* or any in px */
margin: 0 auto; /* for centering */
}
Or you can just replace your ".header" element's 100% width with smaller number!