I am shohel rana. I have been facing a problem since many days. I did not find any solution of my problem.
The problem is:
I have three rows. The row one height will be fit according to their content height and the row three height will be fit according to their content height. But the row two will be fit according to rest of height.
Here is my problem that is showing in picture below:
But I need the result look like this below:
HTML:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<script data-require="[email protected]" data-semver="2.1.1" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link data-require="bootstrap@*" data-semver="3.2.0" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.css" />
<script data-require="bootstrap@*" data-semver="3.2.0" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body>
<div class="container-fluid">
<div class="row row-1">
<div class="col-md-4">ROW1 COLUMN1</div>
<div class="col-md-4">ROW1 COLUMN2</div>
<div class="col-md-4">Lorem ipsum dolor sit amet
Consectetur adipiscing elit Integer molestie lorem at massa Facilisis in pretium nisl aliquet Nulla volutpat aliquam velit Phasellus iaculis neque Purus sodales ultricies Vestibulum laoreet porttitor sem Ac tristique libero volutpat at Faucibus porta lacus fringilla vel Aenean sit amet erat nunc Eget porttitor lorem ROW2 COLUMN1 ROW3 COLUMN1 ROW3 COLUMN2 Lorem ipsum dolor sit amet Consectetur adipiscing elit Integer molestie lorem at massa Facilisis in pretium nisl aliquet Nulla volutpat aliquam velit Phasellus iaculis neque Purus sodales ultricies Vestibulum laoreet porttitor sem Ac tristique libero volutpat at Faucibus porta lacus fringilla vel Aenean sit amet erat nunc Eget porttitor lorem
</html>
CSS:
html,
body {
height: 100%;
width: 100%;
margin: 0px;
padding: 0px;
}
.container-fluid {
background-color: gray;
height: 100%;
}
.row-1 {
background-color: #b200ff;
margin-bottom: 5px;
}
.row-1 > .col-md-4 {
background-color: #0094ff;
border: 1px dashed #111010;
text-align: center;
}
.row-2 {
background-color: #b6ff00;
margin-bottom: 5px;
}
.row-2 > .col-md-12 {
background-color: #ff6a00;
border: 1px dashed #111010;
text-align: center;
}
.row-3 {
background-color: #00ff21;
}
.row-3 > .col-md-4 {
background-color: #00ffff;
border: 1px dashed #111010;
text-align: center;
}
Precaution:
- Avoid display: table, table-row, and table-cell.
- Avoid JavaScript code.