I currently have a widget looking how I want it to a large screen, but have problems when reducing it to something mobile friendly.
The widget has a title section which was two additional fields which need to be floated to right, and only take up as much width as there is text inside of them. I need the title-text on the left to take up the rest of the remaining space.
this is what it looks like
my HTML looks something like this:
<div class="widget">
<div class="section-title">
<div class="title-info">
<div class="info-2">Info 2</div>
<div class="info-1">Info 1</div>
</div>
<div class="title-text">Title</div>
</div>
</div>
CSS looks like this:
.section-title {
height: 100%;
font-size: 1.3em;
color: white;
}
.section-title .title-text {
background-color: #3261AD;
padding: 20px;
}
.section-title .title-info {
display: inline-block;
float: right;
}
.section-title .info-1{
background-color: #264D8C;
padding: 20px;
display: inline-block;
float: right;
}
.section-title .info-2{
background-color: #5BB75B;
padding: 20px;
display: inline-block;
float: right;
}
#media (max-width: 420px) {
.section-title .title-text {
/* ??? */
display: block;
width: 100%;
float: left;
}
.section-title .title-info {
/* ??? */
display: block;
width: 100%;
}
}
The problem occurs when I try to reduce the screen width. I'd like the title-info to collapse beneath the title-text, but can't switch the divs around because then the divs don't float to the right in the order that I want. Is there a way of it look like the image below without sacrificing how it looks on full width or creating a separate markup for mobile?
How I want it to look on mobile
https://jsfiddle.net/cpc4c3kt/
.section-title {
height: 100%;
font-size: 1.3em;
color: white;
}
.section-title .title-text {
background-color: #3261AD;
padding: 20px;
}
.section-title .title-info {
display: inline-block;
float: right;
}
.section-title .info-1 {
background-color: #264D8C;
padding: 20px;
display: inline-block;
float: right;
}
.section-title .info-2 {
background-color: #5BB75B;
padding: 20px;
display: inline-block;
float: right;
}
#media (max-width: 420px) {
.section-title .title-text {
/* ??? */
display: block;
width: 80%;
padding:20px 10%;
float: left;
transform: translateY(-100%);
}
.section-title .title-info {
/* ??? */
display: block;
width: 100%;
transform: translateY(100%);
}
.section-title .title-info>div {
display: inline-block;
float: right;
width: 40%;
padding: 5%;
}
}
<div class="widget">
<div class="section-title">
<div class="title-info">
<div class="info-2">Info 2</div>
<div class="info-1">Info 1</div>
</div>
<div class="title-text">Title</div>
</div>
</div>
Try using Flexbox Grid Layout. Flexbox Layout Module is inbuilt in CSS3 so you don't have to import any CSS. I find it easier to use in positioning complex element layouts.
.section-title {
display: inline-flex;
justify-content: flex-start;
flex-flow: row nowrap;
font-size: 1.3em;
color: white;
width: 100%;
}
.title-text {
flex-basis: 70%;
background: #3261AD;
order: 1;
padding: 20px;
}
.title-info {
flex-basis: 30%;
order: 2;
display: inline-flex;
flex-flow: row nowrap;
}
.info-1 {
background: #264D8C;
order: 1;
flex-basis: 50%;
padding: 20px;
}
.info-2 {
background: #5BB75B;
order: 2;
flex-basis: 50%;
padding: 20px;
}
#media all and (max-width: 420px) {
.section-title {
flex-wrap: wrap;
}
.title-info {
flex-wrap: nowrap;
flex-basis: 100%;
}
.title-text {
flex-basis: 100%;
}
.info-1 {
flex-basis: 50%;
}
.info-2 {
flex-basis: 50%;
}
}
<div class="widget">
<div class="section-title">
<div class="title-info">
<div class="info-2">Info 2</div>
<div class="info-1">Info 1</div>
</div>
<div class="title-text">Title</div>
</div>
</div>
https://jsfiddle.net/yz93799v/
Related
How would I make it so the image resizes properly when viewed on smaller screens. Right now, the image is over the container when viewed on smaller screens. There are also small gaps between the top/left of the container and the image. Would I have to resize the image in the media query or expand the width of my container in the media query?
.container {
width: 88%;
margin: 50px auto;
margin-top: 0px;
}
.heading {
text-align: center;
font-size: 30px;
margin-bottom: 50px;
}
.row {
display: flex;
flex-direction: row;
justify-content: space-around;
flex-flow: wrap;
}
.card {
width: 30%;
background: #fff;
border: 1px solid #ccc;
margin-bottom: 50px;
}
.image {
width: fit-content;
height: fit-content;
}
.card-body {
padding: 30px 10px;
text-align: left;
font-size: 18px;
}
.card-body .btn {
display: block;
color: #fff;
text-align: center;
background: black;
margin-top: 30px;
text-decoration: none;
padding: 10px 5px;
}
#media screen and (max-width: 1000px) {
.card {
width: 40%;
}
.heading {
text-align: auto;
}
.card-header {
margin: auto;
}
.image {
width: fit-content;
height: fit-content;
}
}
#media screen and (max-width: 620px) {
.container {
width: 100%;
}
.heading {
padding: 20px;
font-size: 20px;
text-align: auto;
}
.card {
width: 80%;
}
.image {
width: fit-content;
height: fit-content;
}
}
<div class="container">
<div class="heading">
<h1>Latest Posts</h1>
</div>
<div class="row">
<div class="card">
<div class="image">
<img src="https://via.placeholder.com/1920x1080.jpg">
</div>
<div class="card-body">
<p>
Text Here
</p>
Read more
</div>
</div>
I typically put width: 100%; on images in my projects and height: auto this way the image will be more responsive and scale up and down. You can reduce the width for the smaller media query if you want an even smaller image (width: 85%; for example) or I would probably personally end up reducing the width of the container to get the desired result.
1st: Remove your CSS for the class .image
2nd: Add this CSS line to the base-css (not within the media queries):
img {
object-fit: contain;
width: 100%;
}
What will that do?
object-fit: contain will keep the image aspect ratio while width: 100% will cause the image to fit exactly the given space. The height is set automatically according to the width while it maintain the image aspect ratio as mentioned above.
.container {
width: 88%;
margin: 50px auto;
margin-top: 0px;
}
.heading {
text-align: center;
font-size: 30px;
margin-bottom: 50px;
}
.row {
display: flex;
flex-direction: row;
justify-content: space-around;
flex-flow: wrap;
}
.card {
width: 30%;
background: #fff;
border: 1px solid #ccc;
margin-bottom: 50px;
}
.image {
width: fit-content;
height: fit-content;
}
.card-body {
padding: 30px 10px;
text-align: left;
font-size: 18px;
}
.card-body .btn {
display: block;
color: #fff;
text-align: center;
background: black;
margin-top: 30px;
text-decoration: none;
padding: 10px 5px;
}
img {
object-fit: contain;
width: 100%;
}
#media screen and (max-width: 1000px) {
.card {
width: 40%;
}
.heading {
text-align: auto;
}
.card-header {
margin: auto;
}
}
#media screen and (max-width: 620px) {
.container {
width: 100%;
}
.heading {
padding: 20px;
font-size: 20px;
text-align: auto;
}
.card {
width: 80%;
}
}
<div class="container">
<div class="heading">
<h1>Latest Posts</h1>
</div>
<div class="row">
<div class="card">
<div class="image">
<img src="https://via.placeholder.com/1920x1080.jpg">
</div>
<div class="card-body">
<p>
Text Here
</p>
Read more
</div>
</div>
I want to make a website that would consist of 4 boxes each 50% height and width. I found code that does that, but now I struggle to add images into each box. I want each of the four divs to have a different image, and they should scale according to window size. Any help is appreciated.
Here's my codepen: https://codepen.io/alanvkarlik/pen/OJRdyRR
Here's what I would like to achieve: https://i.imgur.com/7CR7sW8.jpg
HTML:
<div class="container">
<div class="column"><img src="https://f4.bcbits.com/img/a0846297992_16.jpg"></div>
<div class="column">IMG 2</div>
<div class="column">IMG 3</div>
<div class="column">IMG 4</div>
</div>
CSS:
html, body {
height: 100%;
margin: 0;
}
.container {
height: 100%;
}
.column {
height: 25%;
display: flex;
justify-content: center;
align-items: center;
}
#media screen and (min-width: 600px) {
.container {
display: flex;
flex-wrap: wrap;
}
.column {
flex-basis: 50%;
height: 50%;
}
}
/* general styles */
body {
font-family: 'Lato', sans-serif;
font-size: 1.3em;
color: #ccc;
background: #000;
/*margin-bottom: 70px;*/
}
.column {
padding: 15px;
/*border: 1px solid #666;*/
box-sizing: border-box;
}
.column:nth-child(1) {
background: #5c9;
}
.column:nth-child(2) {
background: #fb0;
}
.column:nth-child(3) {
background: #39f;
}
.column:nth-child(4) {
background: #f33;
}
main {
max-width: 1200px;
margin: 0 auto;
}
h1,
h2 {
text-align: center;
}
Not sure if this is what you're trying to achieve but I'd do it with by setting object-fit: contain on images. I also changed a bit the way (css) you're defining the divs.
body {
margin: 0;
}
.container {
display: flex;
flex-wrap: wrap;
}
.column {
height: 50vh;
width: 50vw;
display: flex;
justify-content: center;
align-items: center;
padding: 15px;
box-sizing: border-box;
}
.column img {
height: 100%;
width: 100%;
object-fit: contain;
}
.column:nth-child(1) {
background: #5c9;
}
.column:nth-child(2) {
background: #fb0;
}
.column:nth-child(3) {
background: #39f;
}
.column:nth-child(4) {
background: #f33;
}
<div class="container">
<div class="column"><img src="https://f4.bcbits.com/img/a0846297992_16.jpg"></div>
<div class="column">IMG 2</div>
<div class="column">IMG 3</div>
<div class="column">IMG 4</div>
</div>
I think this is what you are looking for.
Your column img class is set to 100% width and height. I set the height to 50% and the width to auto so it detects the image size and displays it noramlly.
And i simply removed the "object-fit: cover;".
If you change your .colum img {} to the following it should be exactly what you want.
.column img {
height: 50%;
width: auto;
}
I added a snippet so you can see it working.
body {
margin: 0;
}
.container {
display: flex;
flex-wrap: wrap;
}
.column {
height: 50vh;
width: 50vw;
display: flex;
justify-content: center;
align-items: center;
padding: 15px;
box-sizing: border-box;
}
.column img {
height: 50%;
width: auto;
}
.column:nth-child(1) {
background: #5c9;
}
.column:nth-child(2) {
background: #fb0;
}
.column:nth-child(3) {
background: #39f;
}
.column:nth-child(4) {
background: #f33;
}
<div class="container">
<div class="column"><img src="https://f4.bcbits.com/img/a0846297992_16.jpg"></div>
<div class="column">IMG 2</div>
<div class="column">IMG 3</div>
<div class="column">IMG 4</div>
</div>
I'm finding that on mobile, short text that i know can appear in just 1 line is taking up 2 lines.
I've found that "white-space: nowrap" will make sure that it will appear in 1 line. However, now I have a problem where long text that is supposed to take up 2 lines is now forced to appear in 1 line, which is a problem.
What's causing this issue and how do I solve it?
It's the third Lorem Ipsum
<div class="name">Lorem Ipsum </div>
That's causing this problem
What I want is that text that's supposed to take up 1 line (or 2 lines) take up just 1 line (or 2 lines).
.grid article {
position: relative;
}
.students {
position: absolute;
}
.person {
display: flex;
align-items: center;
margin,
padding: 0px;
}
.name {
letter-spacing: 2.2px;
flex: 1;
margin-left: 20px;
}
.picture {
flex: 0 0 28px;
margin: 0;
}
.person img {
margin-top: 0;
margin-bottom: 0;
vertical-align: middle;
}
#media (min-width: 1312px) {
.students {
top: 565px;
}
.name {
font-size: 15px;
letter-spacing: 2.2px;
margin-left: 20px;
}
.person img {
width: 28px;
}
.person {
margin-bottom: -1px;
}
}
#media (max-width: 599px) {
.students {
top: 375px;
}
.name {
font-size: 11px;
letter-spacing: 2.2px;
margin-left: 6px;
}
.person img {
width: 21px;
}
.person {
margin-bottom: 5px;
}
}
<article>
<a href="#">
<div class="photo" style="background-image: url(img/image.png);"></div>
</a>
<div class="text">
<div class="one">Lorem Ipsum</div>
<div class="two">Lorem Ipsum</div>
</div>
<div class="students">
<div class="person">
<div class="picture"><img src="img/sample.jpg"></div>
<div class="name">Lorem Ipsum </div>
</div>
</div>
</article>
Grid Layout CSS
.grid {
display: -ms-flexbox;
-ms-flex-wrap: wrap;
display: grid;
justify-content: start;
margin-top: -20px;
justify-content: space-between;
}
.grid article {
-ms-flex: 0 0 250px;
}
.grid .photo {
width: 100%;
background-size: contain;
background-position: center;
}
.grid .photo:after {
content: "";
display: block;
padding-bottom: 100%;
}
.grid a {
display: block;
text-decoration: none;
color: inherit;
}
.grid a:hover {
opacity: 0.8;
}
.grid .text {
margin: 0px;
}
#media (max-width: 599px) {
.grid {
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
grid-row-gap: 140px;
grid-column-gap: 20px;
margin-top: 18px;
}
}
Do you need the image to be next to the text on mobile?
If you want them to stay aligned then just add flex-direction: row; to your person class in the #media (max-width: 599px) and set a max-width on your picture and name div that doesn't exceed 599px.
If you want them to stack then just add flex-direction: column; to your person class in the #media (max-width: 599px)
Note: You may need to adjust width depending on how much text you want next to your image so it doesn't wrap when it hits the width threshold on mobile.
See snippet below.
.grid article {
position: relative;
}
.students {
position: absolute;
}
.person {
display: flex;
align-items: center;
margin,
padding: 0px;
}
.name {
letter-spacing: 2.2px;
flex: 1;
margin-left: 20px;
}
.picture {
flex: 0 0 28px;
margin: 0;
}
.person img {
margin-top: 0;
margin-bottom: 0;
vertical-align: middle;
}
#media (min-width: 1312px) {
.students {
top: 565px;
}
.name {
font-size: 15px;
letter-spacing: 2.2px;
margin-left: 20px;
}
.person img {
width: 28px;
}
.person {
margin-bottom: -1px;
}
}
#media (max-width: 599px) {
.students {
top: 375px;
}
.name {
font-size: 11px;
letter-spacing: 2.2px;
margin-left: 6px;
display: block;
width: 100%;
}
.picture {
width: 21px;
max-width: 21px;
}
.person {
flex-direction: row;
max-width: 200px;
}
}
<article>
<a href="#">
<div class="photo" style="background-image: url(img/image.png);"></div>
</a>
<div class="text">
<div class="one">Lorem Ipsum</div>
<div class="two">Lorem Ipsum</div>
</div>
<div class="students">
<div class="person">
<div class="picture"><img src="https://cdn.pixabay.com/photo/2020/10/28/11/08/castle-5693094__340.jpg"></div>
<div class="name">Lorem Ipsum </div>
</div>
</div>
</article>
This question already has answers here:
Make a div span two rows in a grid
(2 answers)
Closed 2 years ago.
I'm using display: flex; to create tiles view.
I'm trying to put the third picture under the second picture.
But, whenever I do it, the third picture went under the first picture and won't come under second picture,
#media screen and (min-width: 1000px) {
.main {
height:1800px;
width: 100%;
margin: 0px 0px 0px 0px;
position: relative;
z-index: 0;
}
.parallax {
/* The image used */
background-image: url("https://i.ibb.co/r272XPt/2019-2020.png");
/* Set a specific height */
min-height: 400px;
opacity: 60%;
filter: blur(2px);
-webkit-filter: blur(2px);
/* Create the parallax scrolling effect */
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.tiles{
position:relative;
top:100px;
width:90vw;
margin-left:5vw;
display: flex;
flex-wrap: wrap;
}
.chromebookHelpdesk img{
margin-left:5vw;
width:50vw;
display:block;
}
.subhelp{
height:25vw;
}
.subhelp img{
margin-left:5vw;
width:25vw;
display:block;
}
.studentsTour img{
margin-left:5vw;
width:20vw;
margin-top:5vw;
display:block;
}
#projects img {
text-align: center;
display: block;
width: 25vw;
margin: 20px;
}
.mission_logo {
width: 200px;
display: inline-block;
float: left;
text-align: center;
}
.mission {
text-align: center;
margin-top: 100px;
font-size: 20px;
}
.ingenuity {
color: #3cba54;
font-size: 60px !important;
}
.creativity {
color: #f4c20d;
font-size: 60px !important;
}
.innovation {
color: #db3236;
font-size: 60px !important;
}
}
#media only screen and (max-width: 1000px) {
.main {
height:2500px;
width: 100%;
margin: 0px 0px 0px 0px;
position: relative;
z-index: 0;
}
.parallax {
display: none;
}
.mission_logo {
width: 60vw;
text-align: center;
}
.mission {
text-align: center;
margin-top: 100px;
font-size: 15px;
}
.ingenuity {
color: #3cba54;
font-size: 40px !important;
}
.creativity {
color: #f4c20d;
font-size: 40px !important;
}
.innovation {
color: #db3236;
font-size: 40px !important;
}
}
.tiles h1 {
text-align: center;
font-size: 50px;
color: black;
}
.follow{
position:relative;
top:100px;
text-align:center;
border-radius: 50%;
background-color: #84e3ca;
width: 50vw;
height: 50vw;
margin-left: 25vw;
opacity:70%;
}
.follow h1{
font-size:35px;
padding-top: 20vw;
}
.follow h2{
font-size:30px;
}
<div class="main">
<div class="tiles">
<div class="chromebookHelpdesk"><a href="https://sledteam.github.io/sled/chromebook"><img
src="https://github.com/sledteam/sled/blob/master/Chromebook%20Helpdesk.png?raw=true" alt="Chromebook-Helpdesk"></a></div>
<div class="subhelp"><a href="https://sledteam.github.io/sled/chromebook"><img
src="https://github.com/sledteam/sled/blob/master/Sub%20Help.png?raw=true" alt="Sub Help"></a>
</div>
<div class="studentsTour"><a href="https://sledteam.github.io/sled/chromebook"><img
src="https://github.com/sledteam/sled/blob/master/New%20Students%20Tour.png?raw=true" alt="New Students Tour"></a></div>
</div>
I'm stuck with this for a week.
I would appreciate it if anyone knows a solution for this.
Complete guide to css flexbox
.tiles {
display: flex;
flex-wrap: wrap;
flex-direction: row;
flex: 1;
}
.section {
display: flex;
flex: 1;
flex-direction: column;
}
.item {
display: flex;
flex: 1;
padding: 1rem;
margin: 4px;
background: green;
color: white;
}
<div class="tiles">
<div class="section">
<div class="item">
<p>Chromebook Helpdesk</p>
</div>
</div>
<div class="section">
<div class="item">
<p>Sub Help</p>
</div>
<div class="item">
<p>Student Tour</p>
</div>
</div>
</div>
It is simple if you understand the concept here is the example:
As per your requirement you need 2 columns with single row so you will be creating flex property, now you need 2 columns hence you make it flex:50% like 2. Now coming to your image section where you need 2 images to be underneath so you will provide the height:50%(right images) and you will give height:100%(left image).
You can keep changing the sizes as you desire. You can also add responsive design for the same. Hope it helps.
* {
box-sizing: border-box;
}
.row {
display: flex;
}
.column {
flex: 50%;
padding: 5px;
}
<div class="row">
<div class="column">
<img src="http://i183.photobucket.com/albums/x312/Tiefnuker/office_02_zpsdz0zixcd.jpg" style="width:100%" />
</div>
<div class="column">
<div class="row">
<img src="http://i183.photobucket.com/albums/x312/Tiefnuker/office_02_zpsdz0zixcd.jpg" style="width:50%" />
</div>
<div class="row">
<img src="http://i183.photobucket.com/albums/x312/Tiefnuker/office_02_zpsdz0zixcd.jpg" style="width:50%" />
</div>
</div>
</div>
How to divide a webpage into four equal parts using flex box? Something like this website- www.rileyjshaw.com
The columns should be able to stack upon one another on smaller view ports.
Edit/ Update:
So far I've tried this-
Should I change the line height? How can I achieve distinct blocks?
/* Grid */
.column {
flex-basis: 100%;
width: 50%;
height: 50%;
line-height: 200px;
}
#media screen and (min-width: 800px) {
.row {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}
.column {
flex: 1;
}
._25 {
flex: 2.5;
}
._5 {
flex: 5;
}
}
/* Style */
body {
font-family: 'Lato', sans-serif;
font-size: 1.3em;
color: #ccc;
background: #000;
/*margin-bottom: 70px;*/
}
.column {
/* padding: 15px;
border: 1px solid #666;
margin: 5px 0;*/
background: #343436;
}
main {
max-width: 1200px;
margin: 0 auto;
}
h1,
h2 {
text-align: center;
}
<div class="row">
<div class="column">
50%
</div>
<div class="column">
50%
</div>
</div>
<div class="row">
<div class="column">
50%
</div>
<div class="column">
50%
</div>
</div>
You can simplify the code and gain the wanted output. Here I removed the row's and used a container. The main benefit with this structure is that you can alter the order of the column's if you find that necessary.
I also choose to use flex-basis instead of flex-grow to make them stay 50% wide no matter their content size.
On wider screens, using the media query, set the column's 50% wide and the container to display: flex; flex-wrap: wrap;.
On narrower screens, and being block elements, they stack on top of each other by default
html, body {
height: 100%;
margin: 0;
}
.container {
height: 100%;
}
.column {
height: 25%;
}
#media screen and (min-width: 600px) {
.container {
display: flex;
flex-wrap: wrap;
}
.column {
flex-basis: 50%;
height: 50%;
}
}
/* general styles */
body {
font-family: 'Lato', sans-serif;
font-size: 1.3em;
color: #ccc;
background: #000;
/*margin-bottom: 70px;*/
}
.column {
padding: 15px;
/*border: 1px solid #666;*/
box-sizing: border-box;
}
.column:nth-child(1) {
background: #5c9;
}
.column:nth-child(2) {
background: #fb0;
}
.column:nth-child(3) {
background: #39f;
}
.column:nth-child(4) {
background: #f33;
}
main {
max-width: 1200px;
margin: 0 auto;
}
h1,
h2 {
text-align: center;
}
<div class="container">
<div class="column">
50%
</div>
<div class="column">
50%
</div>
<div class="column">
50%
</div>
<div class="column">
50%
</div>
</div>
If you still need the original markup structure, here is a sample with that too
html, body {
height: 100%;
margin: 0;
}
.row {
height: 50%;
}
.column {
height: 50%;
}
#media screen and (min-width: 600px) {
.row {
display: flex;
}
.column {
flex-basis: 50%;
height: 100%;
}
}
/* general styles */
body {
font-family: 'Lato', sans-serif;
font-size: 1.3em;
color: #ccc;
background: #000;
/*margin-bottom: 70px;*/
}
.column {
padding: 15px;
/*border: 1px solid #666;*/
box-sizing: border-box;
}
.row:nth-child(1) .column:nth-child(1) {
background: #5c9;
}
.row:nth-child(1) .column:nth-child(2) {
background: #fb0;
}
.row:nth-child(2) .column:nth-child(1) {
background: #39f;
}
.row:nth-child(2) .column:nth-child(2) {
background: #f33;
}
main {
max-width: 1200px;
margin: 0 auto;
}
h1,
h2 {
text-align: center;
}
<div class="row">
<div class="column">
50%
</div>
<div class="column">
50%
</div>
</div>
<div class="row">
<div class="column">
50%
</div>
<div class="column">
50%
</div>
</div>
Updated based on a comment
Centering the column's content can be done with i.e.:
Flexbox - https://jsfiddle.net/0ns6ofcp/
.column {
height: 25%;
display: flex; /* added */
justify-content: center; /* hor. center */
align-items: center; /* ver. center */
}
Transform - https://jsfiddle.net/0ns6ofcp/1/
<div class="column">
<div>50%</div>
</div>
.column {
position: relative; /* added property */
height: 25%;
}
.column > div { /* added rule */
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
}
Here is something you can start with:
/* Grid */
.column {
flex-basis: 100%;
height: 50vh;
}
.row {
display: flex;
}
.row:first-child .column:first-child {
background: red;
}
.row:first-child .column:last-child {
background: blue;
}
.row:last-child .column:first-child {
background: green;
}
.row:last-child .column:last-child {
background: black;
}
/* Style */
body {
font-family: 'Lato', sans-serif;
font-size: 1.3em;
color: #ccc;
background: #000;
}
.column {
background: #343436;
}
<div>
<div class="row">
<div class="column">
50%
</div>
<div class="column">
50%
</div>
</div>
<div class="row">
<div class="column">
50%
</div>
<div class="column">
50%
</div>
</div>
</div>