How to align items with different heights? - html

I'm not sure how better to describe it, so:
I have a grid for 12 columns. (2 identical icons and 2 texts with different heights) per 6 columns. Is there any way to align icons by center and texts by the same height? I'm able to align icons but texts are always on different heights.
.benefits .benefits_item {
display: flex;
justify-content: center;
align-items: center;
margin-top: 35px;
min-height: 150px;
}
.benefits .benefits_item .benefits_round {
display: flex;
justify-content: center;
align-items: center;
margin-right: 25px;
width: 116px;
height: 116px;
background: #1EACC7;
border-radius: 50%;
}
.benefits .benefits_item .benefits_descr {
width: 370px;
font-family: 'Roboto';
font-style: normal;
font-weight: 300;
font-size: 15px;
color: #202020;
}
.benefits .benefits_item .benefits_descr span {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-size: 17px;
line-height: 25px;
color: #1EACC7;
<div class="row">
<div class="col-md-6">
<div class="benefits_item">
<div class="benefits_round"><img src="" alt="1" class="benefits_icon"></div>
<div class="benefits_descr"><span>Lorem ipsum dolor sit ame</span><br>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec arcu ligula, lacinia vel fermentum elementum</div>
</div>
</div>
<div class="col-md-6">
<div class="benefits_item">
<div class="benefits_round"><img src="" alt="2" class="benefits_icon"></div>
<div class="benefits_descr"><span>Lorem ipsum</span><br>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec arcu ligula, lacinia vel fermentum elementum, malesuada vel ante. Donec ut odio augue. Integer a aliquet quam. Aenean ut enim ullamcorper, feugiat neque ac,
pretium augue.</div>
</div>
</div>
</div>

You can add align-items-center to <div class="row"> -- Bootstrap's rows use display: flex so you can use other flex utility classes on the row
:root {
--color: #1EACC7;
--iconSize: 6rem;
}
.benefits_round {
height: var( --iconSize );
max-width: var( --iconSize ); min-width: var( --iconSize );
background-color: var( --color );
}
.benefits_descr span { color: var( --color ) }
<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-md">
<div class="row align-items-center">
<div class="col-sm-6">
<div class="d-flex justify-content-center align-items-center">
<div class="benefits_round rounded-circle me-4 d-flex justify-content-center align-items-center">
<img src="" alt="1">
</div>
<div class="benefits_descr fw-light">
<span class="fs-5">Lorem ipsum dolor sit ame</span>
<br>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec arcu ligula, lacinia vel fermentum elementum
</div>
</div>
</div>
<div class="col-sm-6">
<div class="d-flex justify-content-center align-items-center">
<div class="benefits_round rounded-circle me-4 d-flex justify-content-center align-items-center">
<img src="" alt="2">
</div>
<div class="benefits_descr fw-light">
<span class="fs-5">Lorem ipsum</span>
<br>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec arcu ligula, lacinia vel fermentum elementum, malesuada vel ante. Donec ut odio augue. Integer a aliquet quam. Aenean ut enim ullamcorper, feugiat neque ac, pretium augue.
</div>
</div>
</div>
</div>
</div>

Related

How to flip card in HTML

I am new to webdevelopment and have this issue. For this I created a Codepen
For the 6 cards I wanted to ad an image. When I hover over the image it should swap the card and show content. So when the first three cards swaps it still shows up an image instead of the content as the under the first three cards.
So my idea is: when I hover over an image it should swap the card and show only a white background with content as the under three cards.
Can anyone assist me here on how to do it?
.services .icon-box {
text-align: center;
border: 1px solid #e2eefd;
padding: 80px 20px;
transition: all ease-in-out 0.3s;
}
.services .icon-box .icon {
margin: 0 auto;
width: 64px;
height: 64px;
background: #f1f6fe;
border-radius: 4px;
border: 1px solid #deebfd;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
transition: ease-in-out 0.3s;
}
.services .icon-box .icon i {
color: #3b8af2;
font-size: 28px;
transition: ease-in-out 0.3s;
}
.services .icon-box h4 {
font-weight: 700;
margin-bottom: 15px;
font-size: 24px;
}
.services .icon-box h4 a {
color: #222222;
transition: ease-in-out 0.3s;
}
.services .icon-box p {
line-height: 24px;
font-size: 14px;
margin-bottom: 0;
margin-top: 0;
}
.services .icon-box:hover {
border-color: #fff;
box-shadow: 0px 0 25px 0 rgba(16, 110, 234, 0.1);
}
.services .icon-box:hover h4 a, .services .icon-box:hover .icon i {
color: #106eea;
}
.services .icon-box:hover .icon {
border-color: #106eea;
}
.flip-card {
background-color: transparent;
height: 337px;
}
.flip-card:hover .flip-card-inner {
transform: rotateY(180deg);
}
.align-items-stretch:hover .flip-card-front {
display: none;
}
.flip-card-inner{
width: 100%;
height: 100%;
transition: transform 0.6s;
transform-style: preserve-3d;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
background-size: cover;
background-repeat: no-repeat;
}
.flip-card-front, .flip-card-back {
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.flip-card-back {
color: black;
transform: rotateY(180deg);
}
.flip-card:last-child {
margin-bottom: 0;
}
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Roboto:300,300i,400,400i,500,500i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
<section id="services" class="services">
<div class="container" data-aos="fade-up">
<div class="section-title">
<h2>Lorem</h2>
<h3>Lorem <span>.</span></h3>
<p>Praesent in dui nec lorem vulputate hendrerit quis vel nisl. Aenean at auctor augue. Vivamus facilisis pretium suscipit. Praesent nec turpis pellentesque elit iaculis tristique et at justo. Pellentesque feugiat, leo nec rutrum aliquam, dui est pulvinar diam, ut elementum velit nibh vitae ipsum. Morbi id lacinia risus. Etiam faucibus erat ac nibh aliquet laoreet. Sed velit ante, auctor sed imperdiet id, elementum a justo. Nullam condimentum metus vitae porttitor tincidunt.</p>
</div>
<div class="row">
<div class="col-lg-4 col-md-6 d-flex align-items-stretch flip-card" data-aos="zoom-in" data-aos-delay="100">
<div class="icon-box flip-card-inner" style="background-image: url('https://images.unsplash.com/photo-1611095790444-1dfa35e37b52?ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1051&q=80');">
<div class="flip-card-front">
<div class="icon"><i class="bx bxs-user-account"></i></div>
<h4>Lorem</h4>
</div>
<div class="flip-card-back">
<p style="font-size: 16px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ultrices, tellus in ullamcorper sodales, felis dui condimentum dolor, quis feugiat nunc mi nec turpis. Proin convallis ultrices quam et condimentum.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 d-flex align-items-stretch mt-4 mt-md-0 flip-card" data-aos="zoom-in" data-aos-delay="100">
<div class="icon-box flip-card-inner" style="background-image: url('https://images.unsplash.com/photo-1560732488-6b0df240254a?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80');">
<div class="flip-card-front">
<div class="icon"><i class="bx bx-server"></i></div>
<h4>Lorem</h4>
</div>
<div class="flip-card-back">
<p style="font-size: 16px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ultrices, tellus in ullamcorper sodales, felis dui condimentum dolor, quis feugiat nunc mi nec turpis. Proin convallis ultrices quam et condimentum.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 d-flex align-items-stretch mt-4 mt-lg-0 flip-card" data-aos="zoom-in" data-aos-delay="100">
<div class="icon-box flip-card-inner" style="background-image: url('https://images.unsplash.com/photo-1454779132693-e5cd0a216ed3?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1051&q=80');">
<div class="flip-card-front">
<div class="icon"><i class="bx bx-network-chart"></i></div>
<h4>Lorem</h4>
</div>
<div class="flip-card-back">
<p style="font-size: 16px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ultrices, tellus in ullamcorper sodales, felis dui condimentum dolor, quis feugiat nunc mi nec turpis. Proin convallis ultrices quam et condimentum..</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 d-flex align-items-stretch mt-4 flip-card" data-aos="zoom-in" data-aos-delay="100">
<div class="icon-box flip-card-inner" style="text-align: center;">
<div class="flip-card-front">
<div class="icon"><i class="bx bx-world"></i></div>
<h4>Lorem</h4>
</div>
<div class="flip-card-back">
<p style="font-size: 16px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ultrices, tellus in ullamcorper sodales, felis dui condimentum dolor, quis feugiat nunc mi nec turpis. Proin convallis ultrices quam et condimentum.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 d-flex align-items-stretch mt-4 flip-card" data-aos="zoom-in" data-aos-delay="100">
<div class="icon-box flip-card-inner" style="text-align: center;">
<div class="flip-card-front">
<div class="icon"><i class="bx bx-star"></i></div>
<h4>Lorem</h4>
</div>
<div class="flip-card-back">
<p style="font-size: 16px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ultrices, tellus in ullamcorper sodales, felis dui condimentum dolor, quis feugiat nunc mi nec turpis. Proin convallis ultrices quam et condimentum.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 d-flex align-items-stretch mt-4 flip-card" data-aos="zoom-in" data-aos-delay="100">
<div class="icon-box flip-card-inner" style="text-align: center;">
<div class="flip-card-front">
<div class="icon"><i class="bx bx-coin-stack"></i></div>
<h4>Lorem</h4>
</div>
<div class="flip-card-back">
<p style="font-size: 16px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ultrices, tellus in ullamcorper sodales, felis dui condimentum dolor, quis feugiat nunc mi nec turpis. Proin convallis ultrices quam et condimentum.</p>
</div>
</div>
</div>
</div>
</div>
</section>
Thank you very much!
You need to hide the image when you show the back of the card. The easiest way to your given code is to set the size of the background to 0.
.flip-card:hover .flip-card-inner {
transform: rotateY(180deg);
background-size: 0; /* Added to hide the background image. */
}

Align mat-card content(filling blank space issue)

I'm working with mat-card in a list and i have a problem with the aligment
Here what i have:
Here what i want:
The problem is that when the size of content inside a mat card increases,next mat card should automatically adjust the space without leaving a blank space corresponding to previous larger space mat-card
I am attaching the corresponding css and html Code:
.works {
padding-left: 47px;
padding-top: 99px;
// display: inline-flex;
}
.work-head {
// width: 330px;
// height: 28px;
font-family: Raleway-SemiBold;
font-style: normal;
font-weight: 500;
font-size: 24px;
line-height: 28px;
// text-align: center;
color: #000000;
}
.work-list {
// width: 123px;
// height: 28px;
padding-left: 0px;
text-align: right;
padding-top: 23px;
font-family: Raleway-Medium;
font-style: normal;
font-weight: normal;
font-size: 24px;
line-height: 28px;
// text-align: center;
color: #000000;
}
.work-list1 {
// width: 123px;
// height: 28px;
text-align: right;
padding-top: 23px;
font-family: Raleway-Medium;
font-style: normal;
font-weight: normal;
font-size: 24px;
line-height: 28px;
// text-align: center;
padding-left: 49px;
color: #000000;
}
.work-detail {
// width: 159px;
// height: 28px;
padding-left: 0px;
text-align: left;
padding-top: 23px;
font-family: Raleway;
font-style: normal;
font-weight: 300;
font-size: 24px;
line-height: 28px;
// text-align: center;
color: #000000;
}
.flexfix {
flex-basis: 0;
}
.work-card {
// margin-right: 26px;
margin-bottom: 26px;
padding-top: 39px;
padding-left: 17px;
padding-bottom: 49px;
padding-right: 10px;
width: 506px;
// height: 244px;
background: #FFFFFF;
border: 1px solid #E5E5E5;
box-sizing: border-box;
box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.04);
}
.card-margin{
margin-left: 3%;
}
<div class="works">
<div fxLayout="row layout-wrap">
<div *ngFor="let item of listOfProjects" class="card-margin">
<mat-card class="work-card">
<mat-card-title class="work-head">{{item.name}}</mat-card-title>
<img class="line-align" src="assets/icons/DashBoard/work-card-line.svg" />
<mat-card-content>
<div *ngIf="item.name==='test10'">
<div fxLayout="row" fxLayoutGap="20px">
<div class="work-list">Contractor:</div>
<div class="work-detail">{{item.baseEntityByContractor.entityName}}</div>
</div>
<div fxLayout="row" fxLayoutGap="20px">
<div class="work-list">Contractor:</div>
<div class="work-detail">{{item.baseEntityByContractor.entityName}}</div>
</div>
</div>
<div fxLayout="row" fxLayoutGap="20px">
<div class="work-list">Contractor:</div>
<div class="work-detail">{{item.baseEntityByContractor.entityName}}</div>
</div>
<div fxLayout="row" fxLayoutGap="20px">
<div class="work-list1">Status:</div>
<div class="work-detail">{{item.projectStatus.name}}</div>
</div>
</mat-card-content>
</mat-card>
</div>
</div>
</div>
Hope from the below example u will find a solution for ur problem.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<div class="row">
<div class="col-6">
<div class="row">
<div class="col-12">
<div class="card border p-3 mb-2">
<p>Lorericies nisl eget tincidunt. Vestibulum id pulvinar risus. Nam viverra pretium luctus. Morbi turpis tortor pretium luctus. Morbi turpis torto pretium luctus. Morbi turpis torto</p>
</div>
</div>
<div class="col-12">
<div class="card border p-3 mb-2">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris tempor ultricies nisl eget tincidunt. Vestibulutor</p>
</div>
</div>
<div class="col-12">
<div class="card border p-3 mb-2">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris tempor ultricies nisl eget tincidunt. Vr risus. Nam viverra pretium luctus. Morbi turpis tortor</p>
</div>
</div>
<div class="col-12">
<div class="card border p-3 mb-2">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris tempor ultricies nisl eget tincidunt. Vestibulum id pulvinar risus. Nam viverra pretium luctus. Morbi turpis tortor</p>
</div>
</div>
</div>
</div>
<div class="col-6">
<div class="row">
<div class="col-12">
<div class="card border p-3 mb-2">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris tempoar risus. Nam viverra pretium luctus. Morbi turpis tortor</p>
</div>
</div>
<div class="col-12">
<div class="card border p-3 mb-2">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris tempor ultricies nisl eget tincidunt. Vestibulum id pulvinar risus. Nam viverra pretium luctus. Morbi turpis tortor</p>
</div>
</div>
<div class="col-12">
<div class="card border p-3 mb-2">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris tempor</p>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
This is a common css issue, and you need a masonry layout. You can achieve this, with css column-count rule, and whit inline-block elements. You need to add a media query to change the column-count responsively.
See this article, or this example.
With this, you don't need external CSS or JS library.

Aligning multiple boxes on CSS

I'm struggling to align a group of boxes in the center of my webpage when displayed on a computer screen. I'm floating the boxes left but then it's assymetrical with more space on the right. It's currently looking like this:
! https://imgur.com/a/wq0yv6S
I tried a few different alignment properties to the "boxes" and "box" classes but they didn't accomplish anything.
HTML of the section + first box and CSS:
#boxes {
margin-top: 20px;
}
#boxes .box {
float: left;
width: 20%;
padding: 10px;
text-align: center;
align-self: center;
justify-content: space-around;
}
#boxes .box img {
width: 200px;
}
<section id="boxes">
<div class="container">
<div class="box">
<img src="./img/foto0.jpg">
<h2>Pessoa Fisica</h2>
<p>Cuidamos da sua declaracao de imposto de renda</p>
</div>
I'd like to have those boxes positioned symmetrically.
You can use display: grid;
.grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 1em;
}
.grid-item {
background: #F7F7F7;
padding: 1em;
text-align: center;
}
<div class="grid">
<div class="grid-item">1</div>
<div class="grid-item">2</div>
<div class="grid-item">3</div>
<div class="grid-item">4</div>
</div>
You could use flexbox,
it's very easy to start with,
you need to implement this CSS code to the parent container which you need its children to be aligned in someway
.container{
display: flex;
justify-content: center;
align-items: center;
}
<section id="boxes">
<div class="container">
<div class="box">
<img src="./img/foto0.jpg">
<h2>Pessoa Fisica</h2>
<p>Cuidamos da sua declaracao de imposto de renda</p>
</div>
What you're trying to achieve is not too hard with flexbox. See the following demo for an example. If you have any questions please ask :).
Note: The .site div is not needed but added for reference.
.container {
width: 100%;
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
max-width: 960px;
}
.row {
display: flex;
align-items: center;
flex-wrap: wrap;
margin-right: -15px;
margin-left: -15px;
}
.box {
position: relative;
flex-basis: 0;
flex-grow: 1;
max-width: 100%;
padding-right: 15px;
padding-left: 15px;
}
.site {
border: 1px solid red;
}
img {
max-width: 100%;
height: auto;
}
<div class="site">
<div class="container">
<div class="row">
<div class="box">
<img src="https://dummyimage.com/300x200/f9f9f9/aaa" alt="">
<h2>Title #1</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi dui purus, porta sit amet elit ut, pretium dapibus ante. Suspendisse non pharetra odio. Mauris ac placerat libero.</p>
</div>
<div class="box">
<img src="https://dummyimage.com/300x200/f9f9f9/aaa" alt="">
<h2>Title #1</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi dui purus, porta sit amet elit ut, pretium dapibus ante. Suspendisse non pharetra odio. Mauris ac placerat libero.</p>
</div>
<div class="box">
<img src="https://dummyimage.com/300x200/f9f9f9/aaa" alt="">
<h2>Title #1</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi dui purus, porta sit amet elit ut, pretium dapibus ante. Suspendisse non pharetra odio. Mauris ac placerat libero.</p>
</div>
<div class="box">
<img src="https://dummyimage.com/300x200/f9f9f9/aaa" alt="">
<h2>Title #1</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi dui purus, porta sit amet elit ut, pretium dapibus ante. Suspendisse non pharetra odio. Mauris ac placerat libero.</p>
</div>
</div>
</div>
</div>

flexbox with images, fixed size

I created this layout, its almost there but I'm struggling with the images and text beside it. I want the entire box to flex at the same time, to keep the images and text responding at the same time.
What am I doing wrong? I think I am suffering from a mental block because this is my first time using flex.
.container {
max-width: 1750px;
}
.venture,
#event-content,
#news-content {
background-color: #eaeaea;
color: #444;
}
.catch {
color: #fff;
text-align: center;
margin: 1vmin 0vmin 0vmin 0vmin;
padding: 20px 50px;
background-color: #3366cc;
}
.tagline {
margin-top: 5%;
text-align: center;
font-weight: bold;
font-size: 130%;
}
#news-content a:link,
#news-content a:hover,
#news-content a:visited {
text-decoration: none;
color: #444;
font-family: FG Font;
font-size: 2vmin;
}
#news-content .btn.btn-primary {
background-color: #3366cc;
font-family: Arial;
border-color: #3366cc;
}
#news-content .tag {
background-color: #ef8b1e;
display: inline-block;
padding: 5px;
border-radius: 0px 0px 5px 5px;
font-size: 1.5vmin;
font-family: FG Font;
}
#news-content .title {
padding: 25px 10px 0px 10px;
}
#event-content .date {
background-color: #ef8b1e;
font-family: FG Font;
font-size: 3vmin;
display: inline-block;
text-align: center;
}
.main-wrapper {
display: flex;
flex-wrap: nowrap;
height: 70vh;
align-items: stretch;
}
.main-wrapper>div {
width: 50%;
min-height: 50vh;
}
.hero-img {
display: flex;
}
.hero-img>div {
margin: 1vmin;
align-self: stretch;
flex-basis: 50%;
}
.info-section {
display: flex;
flex-direction: column;
align-items: stretch;
}
.info-section .media-section {
margin: 1vmin 0vmin;
}
.info-section .venture {
position: relative;
padding: 3vmin 3vmin 2vmin 3vmin;
}
.media-section>div {
display: flex;
flex-direction: row;
}
.media-section>div>div {
flex-basis: 50%;
}
#news-content {
margin-right: .5vmin;
}
#event-content {
margin-left: .5vmin;
}
#news-content,
#event-content {
max-height: 150px;
}
<div class="container">
<div class="main-wrapper">
<div>
<div class="hero-img">
<div><img src="https://via.placeholder.com/100x100" class="img-fluid" alt="Allied Ship" /></div>
<div><img src="https://via.placeholder.com/100x100" class="img-fluid" alt="Allied Ship" /></div>
</div>
<div class="hero-img">
<div><img src="https://via.placeholder.com/100x100" class="img-fluid" alt="Allied Air" /></div>
<div><img src="https://via.placeholder.com/100x100" class="img-fluid" alt="Allied Helicopter" /></div>
</div>
</div>
<div>
<div class="info-section">
<div class="catch">
<h1>Lorem ipsum dolor sit amet, consectetur adipiscing elit</h1>
</div>
<div class="media-section">
<div>
<div id="news-content">
<div class="tag">In the News</div>
<div class="title">Lorem ipsum dolor sit amet, consectetur adipiscing elit</div>
<a href="">
<div class="btn btn-primary">Link</div>
</a>
</div>
<div id="event-content">
<div class="date">
<div class="num">12</div>
<div class="month">DEC</div>
</div>
<div class="details">
<div class="title">Lorem ipsum dolor sit amet, consectetur adipiscing elit</div>
<div class="info">Lorem ipsum dolor sit amet, consectetur adipiscing elit</div>
</div>
</div>
</div>
</div>
<div class="venture">
<h2>Lorem ipsum dolor sit ametn<br>Lorem ipsum dolor sit amet</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed aliquam diam non mollis sollicitudin. Curabitur sed felis ac urna laoreet finibus nec eu sem. Fusce cursus tortor eget lectus lacinia, id blandit dolor ultrices. Aliquam pellentesque
venenatis turpis, a viverra ante tincidunt vel. Quisque dui orci, viverra id ipsum eget, dictum mattis ante. Aliquam pellentesque massa et euismod efficitur. Aliquam vestibulum velit et lobortis feugiat. Curabitur vulputate quam efficitur,
pellentesque ex quis, tincidunt orci. Donec magna est, ultrices nec pretium nec, porta id nisl. Mauris vitae magna ac sem pellentesque hendrerit. Donec elit justo, pulvinar id leo posuere, venenatis mattis nisl. Maecenas tristique augue ut
odio tincidunt aliquam. Nullam volutpat lobortis eros.</p>
<div class="tagline">LOREM IPSUM</div>
</div>
</div>
</div>
</div>
</div>
Not sure if that you want, the entire container in same column can be done like that :
<pre>
<div class="container">
<div class="main-wrapper">
<div>
<div class="info-section">
<div>
<div class="hero-img">
<div><img src="https://via.placeholder.com/100x100" class="img-fluid" alt="Allied Ship" /></div>
<div><img src="https://via.placeholder.com/100x100" class="img-fluid" alt="Allied Ship" /></div>
</div>
<div class="hero-img">
<div><img src="https://via.placeholder.com/100x100" class="img-fluid" alt="Allied Air" /></div>
<div><img src="https://via.placeholder.com/100x100" class="img-fluid" alt="Allied Helicopter" /></div>
</div>
</div>
<div class="catch">
<h1>Lorem ipsum dolor sit amet, consectetur adipiscing elit</h1>
</div>
<div class="media-section">
<div>
<div id="news-content">
<div class="tag">In the News</div>
<div class="title">Lorem ipsum dolor sit amet, consectetur adipiscing elit</div>
<a href="">
<div class="btn btn-primary">Link</div>
</a>
</div>
<div id="event-content">
<div class="date">
<div class="num">12</div>
<div class="month">DEC</div>
</div>
<div class="details">
<div class="title">Lorem ipsum dolor sit amet, consectetur adipiscing elit</div>
<div class="info">Lorem ipsum dolor sit amet, consectetur adipiscing elit</div>
</div>
</div>
</div>
</div>
<div class="venture">
<h2>Lorem ipsum dolor sit ametn<br>Lorem ipsum dolor sit amet</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed aliquam diam non mollis sollicitudin. Curabitur sed felis ac urna laoreet finibus nec eu sem. Fusce cursus tortor eget lectus lacinia, id blandit dolor ultrices. Aliquam pellentesque
venenatis turpis, a viverra ante tincidunt vel. Quisque dui orci, viverra id ipsum eget, dictum mattis ante. Aliquam pellentesque massa et euismod efficitur. Aliquam vestibulum velit et lobortis feugiat. Curabitur vulputate quam efficitur,
pellentesque ex quis, tincidunt orci. Donec magna est, ultrices nec pretium nec, porta id nisl. Mauris vitae magna ac sem pellentesque hendrerit. Donec elit justo, pulvinar id leo posuere, venenatis mattis nisl. Maecenas tristique augue ut
odio tincidunt aliquam. Nullam volutpat lobortis eros.</p>
<div class="tagline">LOREM IPSUM</div>
</div>
</div>
</div>
</div>
</div>
</pre>

inexplicable space gap in page

I need help with an invisible/inexplicable space gap in my webpage, in the screen screenshots below you can see the space (the red area):
I need that they behavior just like the other row below "LMP" and "LMB"
In Safari the space gap is not present, but in chrome and firefox this space appears, ain honestly I don't kow what to do, i detected that the container class with a width:80% desapears the gap, but then the page becomes too thin.
Here is a
JSfiddle
IF anyone has the same problem, above the titles I have a header, in this I missed a /div so the next row was complete crazy...thanks to all for helping me, i really apreciate the help
You need to make <div class="row">
before any col-md/col-lg/col-sm Because Bootstrap keep 15px Padding for this.
Update jsfiddle solution:
Update solution in codepen Link
And Update Snipper
/***** 3.- NEWS AND CONTENT *******/
.news-section {
background-color: #F1EFEF;
height: 1500px;
}
.black-title {
margin-top: 50px;
height: 60px;
width:112%;
margin-left: -15px;
background-color: #4A90E2;
text-align: center;
line-height: 60px;
}
.black-title > h3 {
vertical-align: middle;
}
.white-title {
margin-top: 50px;
height: 60px;
margin-left: -15px;
background-color: #3F444A;
color: #fff;
text-align: center;
line-height: 60px;
}
.white-title > h3 {
vertical-align: middle;
}
.title-section-2 {
margin-top:0px;
height: 100%;
}
.news-content {
margin-top: 25px;
display: block;
}
.news-content img {
margin:auto;
background-color: #F1EFEF;
}
.news-link {
text-align: right;
margin: 10px;
}
.news-link a {
color: #E7BF3A;
text-decoration: none;
}
.spot-horizontal {
height: 90px;
margin-top: 10px;
background-color: #BD10E0;
}
.logos-horizontal {
height: 50px;
background-color: #3F444A;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<section>
<div class="container">
<div class="row">
<div class="news-section">
<div class="col-md-6 col-sm-6">
<div class="row">
<h3 class=" black-title">Lo más nuevo</h3>
<div class="news-content">
<img class="img-responsive" src="http://placehold.it/500x400" alt="" >
</div>
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="row">
<h3 class="white-title">Videos más nuevos</h3>
<div class="news-content">
<img class="img-responsive" src="http://placehold.it/500x400" alt="" >
</div>
</div>
</div>
<div class="col-md-12 spot-horizontal">
<div class="row">
<h3 class="title-black">PUBLICIDAD</h3>
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="row">
<h3 class=" black-title title-section-2">LMB</h3>
<div class="news-content">
<h4>Titulo de noticia</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean molestie aliquet tristique. Proin aliquam neque quis est sagittis, tempus sagittis tortor mattis. Praesent nec gravida.</p>
<h4>Titulo de noticia</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean molestie aliquet tristique. Proin aliquam neque quis est sagittis, tempus sagittis tortor mattis. Praesent nec gravida.</p>
<div class="news-link">
Más Noticias
</div>
</div>
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="row">
<h3 class="white-title title-section-2">LMP</h3>
<div class="news-content">
<h4>Titulo de noticia</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean molestie aliquet tristique. Proin aliquam neque quis est sagittis, tempus sagittis tortor mattis. Praesent nec gravida.</p>
<h4>Titulo de noticia</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean molestie aliquet tristique. Proin aliquam neque quis est sagittis, tempus sagittis tortor mattis. Praesent nec gravida.</p>
<div class="news-link">
Más Noticias
</div>
</div>
</div>
</div>
<div class="col-md-12 logos-horizontal">
<div class="row">
<h3 class="white-title title-section-2">LOGOS</h3>
</div>
</div>
</div>
</div>
</div>
</section>
Both divs have to be inline-block and have the same parent.
Here's a fiddle: https://jsfiddle.net/fbrh1464/6