I have the following code below, but i am having problem with the spacing. I am using bootstrap. How can i have the title and the value eg " Leonard Moonsoooon". be only 20 px away all the time ?
How can I reduce the spacing?
Senior Advisor Leonard Moonsoooon
Here is my code below and fiddle
FIDDLE
<div id="clientData">
<div class="row">
<div class="col-md-2 col-sm-2 col-xs-6 col-md-2OW">
<div class="name"><strong>Senior Advisor </strong></div>
<!--<div class="account"><strong> Prod </strong></div>
<!-- <div class="approved"><strong> Prod </strong></div>
<div class="activity"><strong> Last Activity </strong></div>
<div class="activity"rong> Risk Category</strong></div> -->
</div>
<div class="col-md-2 col-sm-2 col-xs-6">
<div class="name">Leonard Moonsoooon</div>
<!--<div class="account">0789</div>
<!--<div class="approved">12/5/2015</div>
<div class="activity">4/1/2016</div>
<div class="riskcategory">
<div style="background:Yellow; padding:2px;height:18px; width:50px;"></div>
</div>--->
</div>
<div class="clearfix visible-xs-block"></div>
<div class="col-md-2 col-sm-3 col-xs-6 col-md-2OW12 thirdrdcolTitle">
<div class="brokerage"><strong> Company </strong></div>
<!--<div class="approved"><strong> Max Approved Loan Amt </strong></div>
<div class="balance"><strong> Loan Balance </strong></div>
<div class="credit"><strong> Available Credit </strong></div>
<div class="aging"><strong> Days in this Category </strong></div> -->
</div>
<div class="col-md-2 col-sm-2 col-xs-6">
<div class="pledged "> YUMark</div>
<!--<div class="approved "> $2,050,877.82</div>
<div class="balance "> $1,849,000.00</div>
<div class="credit "> $201,877.82</div>
<div class="aging "> 3</div>-->
</div>
<div class="clearfix visible-xs-block"></div>
<div class="col-md-1 col-sm-1 col-xs-6">
<div class="account"><strong> Production </strong></div>
</div>
<div class="col-md-2 col-sm-2 col-xs-6">
<div class="pledged "> 2351</div>
</div>
</div>
</div>
You have some really funky html going on there. However, the easiest thing you can do is just place both values into one column div, instead of two.
.name strong{margin: 0 20px 0 0;}
<div class="col-md-4 col-sm-4 col-xs-12 col-md-2OW">
<div class="name"><strong>Senior Advisor</strong> Leonard Moonsoooon</div>
</div>
https://jsfiddle.net/pwku8qam/
Related
I have created this table with divs. This is how it is displayed on the screen:
<div class="row my-2">
<div class="col-lg-2">
<strong>Source</strong>
</div>
<div class="col-lg-2">
<strong>Target Language</strong>
</div>
<div class="col-lg-2">
<strong> Price per word</strong>
</div>
<div class="col-lg-2">
<strong>Total words</strong>
</div>
<div class="col-lg-2">
<strong>Total per language</strong>
</div>
<div class="col-lg-2">
<strong>Total Price</strong>
</div>
</div>
And this for entries in tables:
<div class="row my-2">
<div class="col-lg-2 mx-auto my-auto">
script.txt (English)
</div>
<div class="col-lg-2 mx-auto">
<div class="row mx-auto">
German
</div>
<div class="row mx-auto">
Chineese
</div>
<div class="row mx-auto">
French
</div>
</div>
<div class="col-lg-2">
<div class="row mx-auto">
$0.04
</div>
<div class="row mx-auto">
$0.05
</div>
<div class="row mx-auto">
$0.04
</div>
</div>
<div class="col-lg-2 mx-auto my-auto">
× 1245
</div>
</div>
I am getting this on large screen, but not on mobile view.
What can be done to get this same table on mobile view.
With this code when the width of the container is less than 792px the content of the div with the class 'col-xs-6' disappear.
<div class="cont">
<div class="top">
<div class="col-md-3 text-center col-xs-6">
<small>id:</small>
0001
</div>
<div class="col-md-3 text-center col-xs-6">
<small>reference:</small>
PRJ1
</div>
<div class="col-md-3 text-center">
<small>name:</small>
Project 1
</div>
</div>
</div>
how can I display it?
add class name row to top class
<div class="cont">
<div class="top row">
<div class="col-md-3 text-center col-xs-6">
<small>id:</small>
0001
</div>
<div class="col-md-3 text-center col-xs-6">
<small>reference:</small>
PRJ1
</div>
<div class="col-md-3 text-center">
<small>name:</small>
Project 1
</div>
</div>
</div>
I had inserted a row (col-md-12) div inside col-md-2 div. I want row div to take the full width of the page. But it takes only the width of the parent col-md-2. How can I overcome this issue in the bootstrap way?
<div class="options-main row">
<div class="col-md-2 col-sm-3 border-box">
<img src="#" class="img-responsive">
<div class="options-main-sub row">
<div class="col-md-2 col-sm-3 border-box">
</div>
<div class="col-md-2 col-sm-3 border-box">
</div>
<div class="col-md-2 col-sm-3 border-box">
</div>
<div class="col-md-2 col-sm-3 border-box">
</div>
<div class="col-md-2 col-sm-3 border-box">
</div>
<div class="col-md-2 col-sm-3 border-box">
</div>
</div>
</div>
<div class="col-md-2 col-sm-3 border-box">
</div>
<div class="col-md-2 col-sm-3 border-box">
</div>
<div class="col-md-2 col-sm-3 border-box">
</div>
<div class="col-md-2 col-sm-3 border-box">
</div>
<div class="col-md-2 col-sm-3 border-box">
</div>
</div>
This is how it looks in actual. Each column in the first row will have 6 corresponding columns in second row
Use separate row elements for each row that you want to create in your page. This is a basic concept in bootstrap and you should not be going ahead without understanding this concept.
Your problem can be solved as follows:
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="col-xs-2 col-xs-push-2">
Content
</div>
</div>
<div class="row">
<div class="col-xs-2">
Content
</div>
<div class="col-xs-2">
Content
</div>
<div class="col-xs-2">
Content
</div>
<div class="col-xs-2">
Content
</div>
<div class="col-xs-2">
Content
</div>
<div class="col-xs-2">
Content
</div>
</div>
</div>
Please note, in above to code snippet, I have replaced col-md-x with col-xs-x to see same preview on small screens.
Also note the col-xs-push-x class. It is used to set offset. So, in this demo I assume that corresponding to an entry in second column of first row, there are 6 columns in second row.
You need to use some class or id relation to indicate that, a particular second row belongs an entry in first row.
Alternatively, you can enclose second row inside a fixed block
.hover {
position: fixed;
width: 100%;
left: 0
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="row">
<div class="col-xs-2 col-xs-push-2">
Content
<div class="hover">
<div class="row">
<div class="col-xs-2">
Content
</div>
<div class="col-xs-2">
Content
</div>
<div class="col-xs-2">
Content
</div>
<div class="col-xs-2">
Content
</div>
<div class="col-xs-2">
Content
</div>
<div class="col-xs-2">
Content
</div>
</div>
</div>
</div>
</div>
</div>
However, please note that this not a bootstrap way.
How can I horizontally align two columns at col-sm but stack them vertically at col-xs?
I currently have:
<div class="col-md-3 col-sm-12">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-12">Content</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-12">Content</div>
</div>
</div>
Something like
<div class="row">
<div class="col-sm-6 col-xs-12">Content</div>
<div class="col-sm-6 col-xs-12">Content</div>
</div>
Bootply : http://www.bootply.com/u6mMtQvyzX
For Claire :
You don't need this row divs...
<div class="col-md-3 col-sm-12">
<!-- <div class="row"> -->
<div class="col-xs-12 col-sm-6 col-md-12">Content</div>
<!-- </div> -->
<!-- <div class="row"> -->
<div class="col-xs-12 col-sm-6 col-md-12">Content</div>
<!-- </div> -->
</div>
I have a footer on my website with six content blocks.
Depending on the breakpoints, I want to have them in 1x6, 2x3 or 3x2 format.
Without the push and pull classes, the blocks raster is working well on all breakpoints.
But you can imaging that I want to reorder some blocks if it flips from 3x2 to 2x3 format.
<!-- footer -->
<div class="footer">
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4">
</div>
<div class="col-sm-6 col-md-4">
</div>
<div class="col-sm-6 col-sm-push-6 col-md-4">
</div>
<div class="clearfix hidden-sm"></div>
<div class="col-sm-6 col-sm-pull-6 col-md-4">
</div>
<div class="col-sm-6 col-md-4">
</div>
<div class="col-sm-6 col-md-4">
</div>
</div>
</div>
</div>
In SM mode the reordering works fine.
But in LG mode it is still executing the col-sm-push-6 command because it push the 3th div out of the screen.
Is col-sm-push-6 not SM only?
You have to use col-md-push-0 / col-md-pull-0 to "reset" the push/pull for the other grid sizes..
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4">
<div class="well"> </div>
</div>
<div class="col-sm-6 col-md-4">
<div class="well"> </div>
</div>
<div class="col-sm-6 col-sm-push-6 col-md-4 col-md-push-0">
<div class="well"> </div>
</div>
<div class="clearfix hidden-sm"></div>
<div class="col-sm-6 col-sm-pull-6 col-md-4 col-md-pull-0">
<div class="well"> </div>
</div>
<div class="col-sm-6 col-md-4">
<div class="well"> </div>
</div>
<div class="col-sm-6 col-md-4">
<div class="well"> </div>
</div>
</div>
</div>
http://www.bootply.com/126837