Creating Bottom Border on Bootstrap 3 Grid Columns w/ Gutter - css

I have been trying to set up a grid using bootstrap 3 where all the columns will have the same height even with different content sizes - which I have accomplished using flexbox. But now I am trying to add a solid border to the bottom of each item in the grid and I just can't get it to work (I want a border on the bottom, with a gutter between grid elements).
I can do it easily on the top like: https://codepen.io/Wafflenaut/pen/dvzWzb
<div class="container-fluid">
<div class="row" style="display:flex; flex-flow: row wrap;">
<div class="col-xs-12 col-sm-4" >
<div style="border-top:5px solid; border-top-color:#df5400;">
But when I try it on the buttom I get a result like: http://codepen.io/Wafflenaut/pen/perPWL
<div class="container-fluid">
<div class="row" style="display:flex; flex-flow: row wrap;">
<div class="col-xs-12 col-sm-4" >
<div style="border-bottom:5px solid; border-bottom-color:#df5400;">
If I try it directly on the column divs I get a solid bar. So - I basically need to either get a gutter functioning between columns or to get a nested div to go full height. I’ve tried a number of solutions (various padding tricks, vh, etc.), which tend to either not work or to break responsiveness.
And the kicker - this is within a CMS which I lack any access to the css or js files - so everything I do has to be workable inline from within a section of the html body.
Any suggestions for avenues of attack?

You can add display: flex to the div with class="col-xs-12 col-sm-4"
codepen
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid">
<div class="row" style="display:flex; flex-flow: row wrap;">
<div class="col-xs-12 col-sm-4" style="display:flex;">
<div style="border-bottom:5px solid; border-bottom-color:#df5400;">
<p>replace me</p>
<h2>Item 1</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eu nisi fermentum, mollis massa quis, scelerisque elit. Donec nec viverra.</p>
</div>
</div>
<div class="col-xs-12 col-sm-4" style="display:flex;">
<div style="border-bottom:5px solid; border-bottom-color:#df5400;">
<h2>Item 2</h2>
<p>replace me</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris laoreet lectus est. Fusce lobortis, velit sed finibus volutpat, magna nibh porttitor justo, at ornare quam nunc eu nulla. Fusce lacinia.</p>
</div>
</div>
<div class="col-xs-12 col-sm-4" style="display:flex;">
<div style="border-bottom:5px solid; border-bottom-color:#df5400;">
<p>replace me</p>
<h2>Item 3</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eu nisi fermentum, mollis massa quis, scelerisque elit. Donec nec viverra.</p>
</div>
</div>
<div class="col-xs-12 col-sm-4" style="display:flex;">
<div style="border-bottom:5px solid; border-bottom-color:#df5400;">
<h2>Item 4</h2>
<p>replace me</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eu nisi fermentum, mollis massa quis, scelerisque elit. Donec nec viverra.</p>
</div>
</div>
<div class="col-xs-12 col-sm-4" style="display:flex;">
<div style="border-bottom:5px solid; border-bottom-color:#df5400;">
<h2>Item 5</h2>
<p>replace me</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eu nisi fermentum, mollis massa quis, scelerisque elit. Donec nec viverra.</p>
</div>
</div>
<div class="col-xs-12 col-sm-4" style="display:flex;">
<div style="border-bottom:5px solid; border-bottom-color:#df5400;">
<p>replace me</p>
<h2>Item 6</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris laoreet lectus est. Fusce lobortis, velit sed finibus volutpat, magna nibh porttitor justo, at ornare quam nunc eu nulla. Fusce lacinia.</p>
</div>
</div>
</div>
</div>

Apply a height of 100% to each of the inline styles.
<div class="container-fluid">
<div class="row" style="display:flex; flex-flow: row wrap;">
<div class="col-xs-12 col-sm-4" >
<div style="border-bottom:5px solid; border-bottom-color:#df5400; height: 100%">

Related

Bootstrap/CSS: get text aligned left center

I need your help.
I have a column where there is some text. This must be in the center but aligned as shown below.
I tried adding a
display: inline-block; text-align: left
but it does not work.
I should have as shown below:
Other Lorem Stuff
> Lorem ipsum dolor sit amet
> Consectetur adipiscing elit
> Aenean laoreet lectus nec risus
malesuada auctor.
> Vestibulum pellentesque, ante sit
amet congue tempus
note that when the writings go back, they go under the writing and not under the > symbol
This is code:
.footsmall{
background-color: #FFF8DC;
top:-50px;
right: 100px;
height: 300px;
display: inline-block;
text-align: left
}
<div class="col-3 position-absolute footsmall text-center p-3">
<p class="fs-4">Other Lorem Stuff</p>
<p> > <u>Lorem ipsum dolor sit amet</u></p>
<p> > <u>Consectetur adipiscing elit</u></p>
<p> > <u>Aenean laoreet lectus nec risus malesuada auctor.</u></p>
<p> > <u>Vestibulum pellentesque, ante sit amet congue tempus</u></p>
</div>
Can anyone help me please?
You could use a flexbox container for each item.
<div class="d-flex">
<span>></span>
<p class="text-decoration-underline">Lorem ipsum dolor sit amet</p>
</div>
See the working snippet below:
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="col-3 p-3 text-center">
<p class="fs-4">Other Lorem Stuff</p>
<div class="d-flex">
<span>></span>
<p class="text-decoration-underline">Lorem ipsum dolor sit amet</p>
</div>
<div class="d-flex">
<span>></span>
<p class="text-decoration-underline">Consectetur adipiscing elit</p>
</div>
<div class="d-flex">
<span>></span>
<p class="text-decoration-underline">Aenean laoreet lectus nec risus malesuada auctor.</p>
</div>
<div class="d-flex">
<span>></span>
<p class="text-decoration-underline">Vestibulum pellentesque, ante sit amet congue tempus.</p>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
A few things to note, rather than using display and text-align in your CSS you can just add the classes directly to your elements:
<div class="d-inline-block text-start"> </div>
Instead of paragraphs, you could use an unordered list and change the marker style to the chevron you want.
.custom-li {
list-style-type: '> ';
}
<div class="col-3 footsmall text-center">
<p class="fs-4 p-3">Other Lorem Stuff</p>
<ul class="text-start custom-li">
<li>
<u>Lorem ipsum dolor sit amet</u>
</li>
<li>
<u>Consectetur adipiscing elit</u>
</li>
<li>
<u>Aenean laoreet lectus nec risus malesuada auctor.
</li>
<li>
<u>Vestibulum pellentesque, ante sit amet congue tempus</u>
</li>
</ul>
</div>
Is that what you were after? Having the text not end up below your line markers?

How can I get the child divs to match the height of the parent?

<link href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-md-6 about-info js-matchheight" data-wow-offset="10">
<div class="border">
<h3>About Me</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris.</p>
</div>
</div>
<div class="col-xs-12 col-md-6 about-container js-matchheight noPadding" data-wow-offset="10">
<div class="container-fluid">
<div class="row align-items-center">
<div class="col-xs-12 col-md-6 block">
<h4>Weddings</h4>
</div>
<div class="col-xs-12 col-md-6 block">
<h4>Studio</h4>
</div>
<div class="col-xs-12 col-md-6 block">
<h4>Nature</h4>
</div>
<div class="col-xs-12 col-md-6 block">
<h4>Events</h4>
</div>
</div>
</div>
</div>
</div>
</div>
I need help achieving a layout like this:
Desired layout
I'm having trouble getting the child divs on the right to match the height of the parent. Any help would be much appreciated.
In order for children to match the width and height of their parent element you need to remove all padding and margins from the child element. You can then set the height and the width of the child to 100%. The height and width would then be controlled by the parent element.
Here is the code for your solution. Please check
.h-100{
height:100%;
}
.h-50{
height:50%;
}
.block{
text-align:center;
background-color:#f2f2f2;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-md-6 about-info js-matchheight" data-wow-offset="10">
<div class="border">
<h3>About Me</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris.</p>
</div>
</div>
<div class="col-xs-12 col-md-6 about-container js-matchheight noPadding" data-wow-offset="10">
<div class="container-fluid h-100">
<div class="row align-items-center h-100">
<div class="col-xs-12 col-md-6 block h-50">
<div class="d-flex align-items-center h-100 justify-content-center"><h4>Weddings</h4> </div>
</div>
<div class="col-xs-12 col-md-6 block h-50">
<div class="d-flex align-items-center h-100 justify-content-center"><h4>Studio</h4> </div>
</div>
<div class="col-xs-12 col-md-6 block h-50">
<div class="d-flex align-items-center h-100 justify-content-center"><h4>Nature</h4> </div>
</div>
<div class="col-xs-12 col-md-6 block h-50">
<div class="d-flex align-items-center h-100 justify-content-center"> <h4>Events</h4> </div>
</div>
</div>
</div>
</div>
</div>
</div>
.container-fluid .row {
display: grid;
grid-template-columns: 1fr 1fr;
}
.container-fluid .row .about-info {
margin: 40px;
}
.container-fluid .row .about-info .border {
border: 1px solid #0086c5;
padding: 40px;
}
.container-fluid .row .about-info .border h3 {
color: #0086c5;
}
.container-fluid .row .about-container .container-fluid {
height: 100%;
background: #0086c5;
}
.container-fluid .row .about-container .container-fluid .row {
display: grid;
grid-template-columns: 1fr 1fr;
justify-items: center;
align-items: center;
height: 100%;
padding: 40px;
box-sizing: border-box;
}
.container-fluid .row .about-container .container-fluid .row > div {
color: #fff;
text-transform: uppercase;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
}
.container-fluid .row .about-container .container-fluid .row > div h4 {
align-self: center;
}
.container-fluid .row .about-container .container-fluid .row > div:not(:nth-child(2n)) {
border-right: 2px solid #fff;
}
.container-fluid .row .about-container .container-fluid .row > div:not(:nth-last-child(-n + 2)) {
border-bottom: 2px solid #fff;
}
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-md-6 about-info js-matchheight" data-wow-offset="10">
<div class="border">
<h3>About Me</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris.</p>
</div>
</div>
<div class="col-xs-12 col-md-6 about-container js-matchheight noPadding" data-wow-offset="10">
<div class="container-fluid">
<div class="row align-items-center">
<div class="col-xs-12 col-md-6 block">
<h4>Weddings</h4>
</div>
<div class="col-xs-12 col-md-6 block">
<h4>Studio</h4>
</div>
<div class="col-xs-12 col-md-6 block">
<h4>Nature</h4>
</div>
<div class="col-xs-12 col-md-6 block">
<h4>Events</h4>
</div>
</div>
</div>
</div>
</div>
</div>

How to align the text under and side of the image and put them in same row with css bootstrap 4

I want to align the 2 different texts side and under the image as 1 article.
and want to put 2 articles in same row when the window size is col-md or bigger.
I want the second article to be displayed under the article 1 when the window size is smaller than col-sm.
I have tried the below code but I could not put them in same row.
How to put them in the same row?
<div class="row">
<div class = 'col-4 col-md-2'>
<img class="rounded-circle" src="http://placehold.it/150x150" width="150" alt="Generic placeholder image">
</div>
<div class="col-8 col-md-4">
<p>"aricle 1 : Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec varius venenatis neque, id commodo magna fermentum id."
</div>
</div>
<div class="row">
<div class="col-12 col-md-6">
<p>"article 2 : Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec varius venenatis neque, id commodo magna fermentum id."
</div>
</div>
<div class="row">
<div class = 'col-4 col-md-2'>
<img class="rounded-circle" src="http://placehold.it/150x150" width="150" alt="Generic placeholder image">
</div>
<div class="col-8 col-md-4">
<p>"aricle 1 : Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec varius venenatis neque, id commodo magna fermentum id."
</div>
</div>
<div class="row">
<div class="col-12 col-md-6">
<p>"aricle 2: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec varius venenatis neque, id commodo magna fermentum id."
</div>
</div>
You should use display:flex; for the row.For when screen size is less, you should consider #media queries.If you need anything else, please let me know.
#media all and (min-width:992px){
.art{
margin-left:80px;
}
}
#media all and (min-width:768px) and (max-width:991px){
.art{
margin-left:100px!important;
}
}
#media all and (min-width:768px){
.container{
display:flex;
flex-direction:row;
}
.row{
flex-direction:row;
}
}
.row{
display:flex;
}
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="container-fluid">
<div class="row">
<div class ="col-4 col-md-2">
<img class="rounded-circle" src="http://placehold.it/150x150" width="150" alt="Generic placeholder image">
</div>
<div class="art col-8 col-md-6">
<p>"article 1 : Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec varius venenatis neque, id commodo magna fermentum id."
</div>
</div>
<div class="row">
<div class="col-12 col-md-6">
<p>"article 2 : Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec varius venenatis neque, id commodo magna fermentum id."
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class ="col-4 col-md-2">
<img class="rounded-circle" src="http://placehold.it/150x150" width="150" alt="Generic placeholder image">
</div>
<div class="art col-8 col-md-6">
<p>"article 1 : Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec varius venenatis neque, id commodo magna fermentum id."
</div>
</div>
<div class="row">
<div class="col-12 col-md-6">
<p>"article 2: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec varius venenatis neque, id commodo magna fermentum id."
</div>
</div>
</div>
</div>
</body>
</html>

How to set column height equal in few rows Bulma (flexbox)?

I'm using Bulma 0.4.0, though the answer may not be associated with Bulma itself.
How can I set column height equal to others? (see codepen below)
Notice they are all in another column container, and there are few rows of those columns.
Expected behaviour: (woah i made optical illusion)
https://codepen.io/anon/pen/JNKexr
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.4.0/css/bulma.css" />
</head>
<body>
<div class="columns">
<div class="column">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eu consectetur lorem, nec facilisis dolor. Morbi rhoncus, mi sit amet ornare tincidunt, augue sem aliquet mauris, non pretium orci nisl at est. Curabitur placerat pharetra augue. Etiam non eros nulla. Praesent aliquet sem dui, id varius enim convallis vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec convallis mauris felis, sit amet consectetur augue sollicitudin id.
</div>
<div class="column">
<div class="columns">
<div class="column">
<p class="notification is-info">Lorem ipsum</p>
</div>
<div class="column">
<p class="notification is-success">Nulla a mauris vel </p>
</div>
</div>
<div class="columns">
<div class="column">
<p class="notification is-info">Lorem ipsum</p>
</div>
<div class="column">
<p class="notification is-success">Nulla a mauris vel </p>
</div>
<div class="column">
<p class="notification is-warning">Pellentesque
</p>
</div>
<div class="column">
<p class="notification is-danger">Morbi turpis nunc</p>
</div>
</div>
<div class="columns">
<div class="column">
<p class="notification is-info">Lorem ipsum dolor sit amet</p>
</div>
<div class="column">
<p class="notification is-success">Nulla</p>
</div>
<div class="column">
<p class="notification is-warning">Pellentesque eros tortor,
</p>
</div>
<div class="column">
<p class="notification is-danger">Morbi</p>
</div>
</div>
<div class="columns">
<div class="column">
<p class="notification is-info">Lorem ipsum dolor sit amet</p>
</div>
<div class="column">
<p class="notification is-success">Nulla</p>
</div>
<div class="column is-6">
<p class="notification is-warning">Pellentesque eros tortor,
</p>
</div>
</div>
</body>
</html>
Question is related to my previous one: How to set column height equal to longest column in Bulma (flexbox)?
edit: corrected title
edit2: it has something to do with align-content: stretch; class, though I'm have no idea how to use it. More info: http://cssreference.io/flexbox/#align-content
try to add the css code:
p.notification {
height: 100%;
}
I used the following CSS rule, this way I can use the class .is-equal-height to have aligned columns.
.columns.is-equal-height > .column > * {
height: 100% !important;
}

Bootstrap Affix conflicting CSS

I want to affix the following code to the top of the page, below the nav so it is always visible.
<div class="col-lg-5 nopadd affix">
<h3>Project One</h3>
<p>Lorem ipsum dolor ...</p>
</div>
However when I add the bootstrap .affix it makes it ignore the col-lg-5 class that has been applied.
Here is the code I have so far.
http://jsfiddle.net/P9d5k/2/
http://jsfiddle.net/P9d5k/2/embedded/result/
try this fiddle
I just add a 100% width div with the affix class and inside a .container with your grid inside
<div class="affix" style="width:100%;z-index:2">
<div class="container">
<div class="col-lg-5">
<h3>Project One</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam viverra euismod odio, gravida pellentesque urna varius vitae. Sed dui lorem, adipiscing in adipiscing et, interdum nec metus. Mauris ultricies, justo eu convallis placerat, felis enim.</p>
</div>
</div>
</div>

Resources