Images with text not getting aligned side by side - html

I want these these 3 sections to be side by side
I want these three sections of the class box to be in line side by side. I don't know what is wrong with my code. I've cross checked it many time with the code from the instructor.
Thanks for your help.
ul {
margin: 0;
padding: 0;
}
/* Global */
.container {
width: 80%;
margin: auto;
overflow: hidden;
}
/* BOXES */
#boxes {
margin-top: 20px;
}
#boxes .box {
float: left;
width: 25%;
padding: 10px;
text-align: center;
}
#boxes .box img {
width: 90px;
}
<section id="boxes">
<div class="container">
<div class="box">
<img src="./images/html5.png" alt="html5">
<h3>HTML 5 Markup</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste corrupti incidunt cumque, delectus ullam</p>
</div>
</div>
<div class="container">
<div class="box">
<img src="./images/css3.png" alt="css3">
<h3>CSS 3 Styling</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste corrupti incidunt cumque, delectus ullam</p>
</div>
</div>
<div class="container">
<div class="box">
<img src="./images/brush.png" alt="brush">
<h3>Graphic Design</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste corrupti incidunt cumque, delectus ullam</p>
</div>
</div>
</section>

You can use display: flex in the #boxes selector in your CSS file.

If you want them to be side by side you can just use flex
#boxes {
margin-top: 20px;
display: flex;
justify-content: center;
}

You can try this:
ul {
margin: 0;
padding: 0;
}
/* Global */
.container {
width: 80%;
margin: auto;
overflow: hidden;
}
/* BOXES */
#boxes {
display: flex;
margin-top: 20px;
}
#boxes .box {
float: left;
width: 25%;
padding: 10px;
text-align: center;
}
#boxes .box img {
width: 90px;
}
<section id="boxes">
<div class="container">
<div class="box">
<img src="./images/html5.png" alt="html5">
<h3>HTML 5 Markup</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste corrupti incidunt cumque, delectus ullam</p>
</div>
</div>
<div class="container">
<div class="box">
<img src="./images/css3.png" alt="css3">
<h3>CSS 3 Styling</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste corrupti incidunt cumque, delectus ullam</p>
</div>
</div>
<div class="container">
<div class="box">
<img src="./images/brush.png" alt="brush">
<h3>Graphic Design</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste corrupti incidunt cumque, delectus ullam</p>
</div>
</div>
</section>

You can use display:flex to the #boxes. It will make its child to be in one row.
Learn more about flex https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox;
body {
/* font-family: Arial, Halvetica, sans-serif;
font-size: 15px;
line-height: 1.5em; */
font: 15px/1.5 Arial, Halvetica, sans-serif;
padding: 0;
background-color: #f4f4f4;
}
ul {
margin: 0;
padding: 0;
}
a:hover {
color: #cccccc;
}
/* Global */
.container {
width: 80%;
margin: auto;
overflow: hidden;
}
.button_1 {
height: 38px;
background: #e8491d;
border: none;
padding: 0px 20px 0px 20px;
font-style: oblique;
font-weight: bold;
color: white;
}
/*header*/
header {
background: #35424a;
color: #ffffff;
padding-top: 30px;
min-height: 70px;
border-bottom: #e8491d 3px solid;
}
header a {
color: white;
text-decoration: none;
text-transform: uppercase;
font-size: 16px;
}
header li {
float: left;
display: inline;
padding: 0 20px 0 20px;
}
header #branding {
float: left;
}
header #branding h1 {
margin: 0;
}
header nav {
float: right;
margin-top: 10px;
}
header .highlight, header .current a {
color: #e8491d;
font-weight: bold;
}
/* showcase */
#showcase {
min-height: 400px;
background: url("../images/showcase.jpg") no-repeat 0-400px;
text-align: center;
color: white;
}
#showcase h1 {
margin-top: 100px;
font-size: 55px;
margin-bottom: 10px;
}
#showcase p {
font-size: 20px;
}
/*NewsLetter */
#newsletter {
padding: 15px;
color: white;
background: #35424a;
}
#newsletter h1 {
float: left;
}
#newsletter form {
margin-top: 22px;
float: right;
}
#newsletter input[type="email"] {
padding: 4px;
height: 25px;
width: 250px;
}
/* BOXES */
#boxes {
margin-top: 20px;
display:flex;
}
#boxes .box {
width: 25%;
padding: 10px;
text-align: center;
}
#boxes .box img {
width: 90px;
}
<body>
<header>
<div class="container">
<div id="branding">
<h1><span class="highlight">Sumanyu</span> Web design</h1>
</div>
<nav>
<ul>
<li class="current">Home</li>
<li class="current">About</li>
<li class="current">Services</li>
</ul>
</nav>
</div>
</header>
<section id="showcase">
<div class= "container">
<h1>Affordable professional Web Design</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste corrupti incidunt cumque, delectus ullam aut reprehenderit debitis doloremque, necessitatibus, nulla, ab fuga reiciendis rerum culpa possimus illum labore sit laudantium.</p>
</div>
</section>
<section id="newsletter">
<div class="container">
<h1>Subscribe to Our Newsletter</h1>
<form class="process.php" action="index.html" method="post">
<input type="email" placeholder="Enter your Email">
<button type="submit" class="button_1">Subscribe</button>
</form>
</div>
</section>
<section id="boxes">
<div class="container">
<div class="box">
<img src="./images/html5.png" alt="html5">
<h3>HTML 5 Markup</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste corrupti incidunt cumque, delectus ullam</p>
</div>
</div>
<div class="container">
<div class="box">
<img src="./images/css3.png" alt="css3">
<h3>CSS 3 Styling</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste corrupti incidunt cumque, delectus ullam</p>
</div>
</div>
<div class="container">
<div class="box">
<img src="./images/brush.png" alt="brush">
<h3>Graphic Design</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste corrupti incidunt cumque, delectus ullam</p>
</div>
</div>
</section>
<footer>
<p>Sumanyu Sood Web Design, Copyright © 2020 </p>
</footer>
</body>
</html>

Related

Flip box hover with image as background

im using a flip box with a front and back content when i hover (rotateY(180deg)) . that worked for simple container (only text) but didn't work when the background was an image this is my first time using nth-child element so any advises are welcome^^.
(its a small screen version for now)
and thanks in advance.
/*
===============
SERVICES
===============
*/
.title-service {
margin-top: 100px;
text-align: center;
}
.title-service p {
margin-top: -30px;
}
.container-service {
width: 70vh;
height: 50vh;
margin-left: 30px;
background: grey;
margin-bottom: 10px;
align-items: center;
text-align: center;
padding-top: 25%;
transform-style: preserve-3d;
transition: 0.3s ease all;
}
.container-service:hover {
transform: rotateY(180deg);
}
.front-card {
backface-visibility: hidden;
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
}
.back-card {
backface-visibility: hidden;
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
transform: rotateY(180deg);
}
.container-service h3 {
color: black;
font-size: 26px;
font-weight: 700;
}
.container-service i {
font-size: 40px;
color: black;
}
.container-service:nth-child(3) {
background-image: url(../Responsive\ Website/img-2.jpg);
background-size: cover;
position: relative;
}
.container-service:nth-child(3) .front-card::after {
content: "";
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: -1;
}
.dev h3 {
color: whitesmoke;
}
.dev i {
color: whitesmoke;
}
<!-- START SERVICES -->
<section class="service">
<div class="info-service">
<div class="title-service">
<h1>SERVICES</h1>
<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit.</p>
</div>
<div class="container-service web">
<div class="front-card">
<span><i class="fas fa-palette"></i></span>
<h3>Web Design</h3>
</div>
<div class="back-card">
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Libero
maxime, reiciendis, ut earum amet architecto, cum magni cumque eum
repudiandae a minus sunt! Sed porro expedita, fuga aspernatur
molestiae iste ab cupiditate repudiandae cumque officia ea.
Tenetur amet ullam voluptatum?
</p>
</div>
</div>
<div class="container-service f-e">
<div class="dev">
<div class="front-card">
<span><i class="fas fa-laptop-code"></i></span>
<h3>Front Dev</h3>
</div>
<div class="back-card">
<h3>Front Dev</h3>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Fugit
optio, eum esse doloremque molestias aspernatur.
</p>
</div>
</div>
</div>
<div class="container-service branding">
<div class="front-card">
<span><i class="fas fa-building"></i></span>
<h3>Branding</h3>
</div>
<div class="back-card">
<h3>Branding</h3>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Consequuntur, error.
</p>
</div>
</div>
</div>
</section>
<!-- END SERVICES -->
The front and back are stacked above the parent wrapper and have inherited the parent background color, try applying the image to the front card of the third child.

CSS - Need basic chat ui

I am developing a chat system UI, I faced problems with aligning items left and right
I want to display my message on the right and someone else's messages on the left.
Current code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
#container {
margin: 5% auto;
width: 40%;
padding: 10px;
margin-bottom: 40px;
border: 1px solid red;
}
.chat {
border: 1px ridge #34495e;
}
.msg-box {
background: green;
width: 50%;
padding: 10px;
}
</style>
</head>
<body>
<div id="container">
<div class="chat">
<p class="border msg-box msg-my">Lorem ipsum, dolor sit amet consectetur, adipisicing elit. Vitae, accusan</p>
<p class="border msg-box">Lorem ipsum, dolor sit amet consectetur, adipisicing elit. Vitae, accusan</p>
</div>
</div>
</body>
</html>
NOTE need just alignment left and right, not styling elements.
Example:
Perhaps this will get you started:
https://codepen.io/riza-khan/pen/dyXjwoW
<div class="chat-container">
<div class="me">Hi! How are you?</div>
<div class="you">Hello! Great, and yourself?</div>
<div class="me">Pretty good! How's the weather on your end?</div>
<div class="you">Getting chilly, winter is almost here :)</div>
<div class="me">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Modi eos nemo totam illum consequuntur hic exercitationem laudantium ab doloribus debitis.</div>
<div class="you">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Modi eos nemo totam illum consequuntur hic exercitationem laudantium ab doloribus debitis.</div>
</div>
.chat-container {
display: flex;
flex-direction: column;
.me,
.you {
margin-top: 1.5rem;
padding: 0.5rem;
border-radius: 0.5rem;
}
.me {
margin-left: auto;
border: solid 1px blue;
max-width: 55%;
}
.you {
margin-right: auto;
border: solid 1px red;
max-width: 55%;
}
}
.chat{
display:flex;
flex-direction:column;
background: #f0f0f0;
width: 400px;
}
.chat_bubble_container{
display:flex;
width: 400px;
}
.chat_bubble_container.incoming{
justify-content: flex-start;
}
.chat_bubble_container.outgoing{
justify-content: flex-end;
}
.chat_bubble_container .chat_bubble{
display:flex;
padding: 4px;
border-radius: 5px;
margin: 5px;
}
.chat_bubble_container.incoming .chat_bubble{
background: #d1d1d1;
}
.chat_bubble_container.outgoing .chat_bubble{
background: #429bd7;
color: white;
}
<div class="chat">
<div class="chat_bubble_container incoming">
<div class="chat_bubble">Hi</div>
</div>
<div class="chat_bubble_container outgoing">
<div class="chat_bubble">Hi</div>
</div>
<div class="chat_bubble_container incoming">
<div class="chat_bubble">Lorem ipsum</div>
</div>
<div class="chat_bubble_container outgoing">
<div class="chat_bubble">Lorem ipsum</div>
</div>
</div>
This was solution :/
.msg-my {
margin-left: auto;
}

Timeline with images in center

Can someone please help me?!
I'm trying to code a PSD file to HTML and CSS, but I'm struggling with one of the sections. Here's an image of what I want to do:
Click Here
The problem is I don't know how to put the image in the timeline line. I tried to add the image in the ::after psuedo, but I don't think this is the right way of doing that.
This is my HTML Code :
<section class="about">
<div class="wrapper">
<h3>About Us</h3>
<p>Lorem ipsum dolor sit amet consectetur.</p>
<div class="container left">
<div class="content">
<h5>JULY 2010<br> Our Humble Beginnings</h5>
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Rerum officia labore fugit nihil nulla laboriosam praesentium harum ut, odio ea facere, recusandae reprehenderit repellat.</p>
</div>
</div>
<div class="container right">
<div class="content">
<h5>January 2011<br> Facing Startups Battles</h5>
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Rerum officia labore fugit nihil nulla laboriosam praesentium harum ut, odio ea facere, recusandae reprehenderit repellat.</p>
</div>
</div>
</div>
</section>
This is my CSS code:
.about .wrapper{
padding: 80px 10%;
text-align: center;
position: relative;
}
.about .wrapper::after{
content: '';
position: absolute;
top: 200px;
bottom: 0;
width: 6px;
background: red;
}
.about h5{
line-height: 1.5;
font-size: 1em;
padding-bottom: .5em;
}
.about .container{
position: relative;
width: 50%;
top: 60px;
margin: 0 0 60px 0;
}
.about .container::after{
content: 'How Can I Add an Image Here in this circle?';
position: absolute;
width: 200px;
height: 200px;
border-radius: 50%;
top: 20px;
right: -104px;
background-color: blue; /* Just because there is no image */
background-image: url(assets/img/about-1.png);
background-repeat: no-repeat;
background-size: cover;
z-index: 2;
}
.left{
text-align: right;
}
.right{
text-align: right;
}
.content{
padding: 30px 0px 80px 0px;
}
.left .content{
padding-right: 140px;
}
.right .content{
padding-left: 140px
}
.right{
text-align: left;
left: 50%;
}
.right:after {
left: -104px;
}
I think this is called a timeline, there is a lot of tutorials talking about how to do something like this, but I don't know how to make the images in the timeline line. Can you please help me do this?
Thanks
To build this, you could use css grid layout (guide: https://css-tricks.com/snippets/css/complete-guide-grid/)
Treat each of the content+image as a row in the layout. And each row as a container for a grid.
You can visually break every row down to 3 columns. One column for left-side content, the second one for the image and the third one for right-side content.
Example css grid for a layout like this:
.grid-container {
display: grid;
grid-template-columns: 1fr 10em 1fr;
grid-template-rows: 1fr;
grid-template-areas: "content-left image content-right";
text-align: center;
}
.content-left { grid-area: content-left; background: lightblue; }
.image { grid-area: image; background: lightgreen; }
.content-right { grid-area: content-right; background: lightblue; }
<div class="grid-container">
<div class="content-left">Left content</div>
<div class="image">Image</div>
<div class="content-right">Right content</div>
</div>
(grid generated with: https://grid.layoutit.com/)
To alternate between content on the left and on the right, you can use css even/odd selectors (How can I style even and odd elements?) to set which grid area is used for the element.
Example:
I've built an example of a timeline layout for this answer which you can find at https://codepen.io/hendrysadrak/pen/VwLEraz
Try this:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="main.css" />
<title></title>
</head>
<body>
<section class="about">
<div class="wrapper">
<div>
<h3>About Us</h3>
<p>Lorem ipsum dolor sit amet consectetur.</p>
</div>
<div id="container">
<div class="row">
<div id="col1" class="col right">
<h5>JULY 2010<br> Our Humble Beginnings</h5>
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Rerum officia labore fugit nihil nulla laboriosam praesentium harum ut, odio ea facere, recusandae reprehenderit repellat.</p>
</div>
<div id="col2" class="col"><img class="img" src="assets/img/about-1.png"/></div>
</div>
<div class="row2" >
<div id="col3" class="col"><img class="img" src="assets/img/about-1.png"/></div>
<div id="col4" class="col left">
<h5>JULY 2010<br> Our Humble Beginnings</h5>
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Rerum officia labore fugit nihil nulla laboriosam praesentium harum ut, odio ea facere, recusandae reprehenderit repellat.</p>
</div>
</div>
</div>
</div>
</section>
</body>
</html>
in main.css file:
.about .wrapper{
padding: 80px 10%;
text-align: center;
}
.about h5{
line-height: 1.5;
font-size: 1em;
padding-bottom: .5em;
}
.row {
width: 59%;
margin-right: 41%;
display: flex;
}
.row2 {
width: 59%;
display: flex;
margin-left: 41%;
}
.col {
flex:1;
}
.col.left {
text-align: left;
}
.col.right {
text-align: right;
}
#col2 {
flex-basis: 30%;
}
#col1 {
flex-basis: 70%;
}
#col3 {
flex-basis: 30%;
}
#col4 {
flex-basis: 70%;
}
.img {
margin: 10% 5%;
width: 90%;
border-radius: 50%;
}
#container {
background-image: linear-gradient(lightgrey,lightgrey);
background-size: 2px 100%;
background-repeat: no-repeat;
background-position: center center;
}
put this in assets/img/about-1.png

Make navbar exceed max-width [CSS]

Currently experimenting with HTML and CSS and am struggling with this issue.
I'm messing around with a responsive website, and somehow can't make my navigation bar exceed the max-width of my navbar exceed the max-width of my content.
What I'd like it to look like https://imgur.com/a/KAk9mOi
I do really hope anyone can help me.
TIA.
<nav class="navbar">
<ul class="nav-items">
<li class="nav-item nav-item--active">Home</li>
<li class="nav-item">Contact</li>
</ul>
</nav>
.main {
}
.navbar {
padding: 20px;
background-color: #1C2826;
max-width: 100%;
}
.nav-items {
display: flex;
justify-content: center;
}
.nav-items > li {
flex: 1;
text-align: center;
}
.nav-item:not(:last-of-type) {
margin-right: 20px;
}
.nav-item--active {
/* after */
}
.content {
padding: 8px;
}
.login-card {
border: 1px solid #999;
margin-bottom: 20px;
padding: 12px;
border-radius: 4px;
}
.login {
display: flex;
flex-direction: column;
}
.login-button {
background-color: #D64550;
padding: 4px;
border: none;
color: #ffffff;
font-size: 20px;
}
.login-input {
margin-bottom: 8px;
border: none;
border-bottom: 1px solid #999;
padding-top: 4px;
padding-bottom: 4px;
}
.footer {
padding: 8px;
}
.inline-block {
display: inline-block;
}
/* Alt over 460px */
#media only screen and (min-width: 460px) {
.main{
max-width: 600px;
}
.navigation-items{
flex-wrap: wrap;
}
.login-button {
font-size: inherit;
}
}
https://jsfiddle.net/m0u79e8s/
I hope this is useful
* {
padding: 0px;
margin: 0px;
}
.main {
}
.navbar {
padding: 20px;
background-color: #1C2826;
width: 100%;
}
.nav-items {
display: flex;
justify-content: center;
}
.nav-items > li {
flex: 1;
text-align: center;
}
.nav-item:not(:last-of-type) {
margin-right: 20px;
}
.nav-item--active {
/* after */
}
.content {
padding: 8px;
}
.login-card {
border: 1px solid #999;
margin-bottom: 20px;
padding: 12px;
border-radius: 4px;
}
.login {
display: flex;
flex-direction: column;
}
.login-button {
background-color: #D64550;
padding: 4px;
border: none;
color: #ffffff;
font-size: 20px;
}
.login-input {
margin-bottom: 8px;
border: none;
border-bottom: 1px solid #999;
padding-top: 4px;
padding-bottom: 4px;
}
.footer {
padding: 8px;
}
.inline-block {
display: inline-block;
}
/* Alt over 460px */
#media only screen and (min-width: 460px) {
.main {
display: flex;
flex-direction: column;
align-items: center;
}
.content {
max-width: 460px;
}
.navigation-items{
flex-wrap: wrap;
}
.login-button {
font-size: inherit;
}
}
<!doctype html>
<html>
<head>
<title>Responsive time</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Raleway:400,600,700" rel="stylesheet">
<link rel="stylesheet" href="./reset.css">
<link rel="stylesheet" href="./generic.css">
<link rel="stylesheet" href="./styles.css">
</head>
<html>
<body>
<main class="main">
<!-- Navigation elements -->
<nav class="navbar">
<ul class="nav-items">
<li class="nav-item nav-item--active">Home</li>
<li class="nav-item">Contact</li>
</ul>
</nav>
<!-- Section -->
<section class="content">
<h1 class="test">Time to get responsive</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Labore deleniti, quia provident!</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis quas alias reiciendis velit, dolor eos temporibus culpa ex modi itaque nostrum natus doloribus sed maiores, a obcaecati quia sequi quisquam corrupti perspiciatis sit quam, qui expedita. Nemo sed dolor earum voluptate quod reiciendis rem laborum atque ex nulla sapiente ea ullam assumenda, fugiat quae incidunt dicta, cupiditate repellendus possimus aliquid! Ad veniam vero alias, rem quod atque dolores saepe possimus, tempora, eaque magnam culpa animi repellendus ratione dolorem harum quo.</p>
<!-- Form -->
<div class="login-card">
<form class="login" action="#" method="get">
<input class="login-input" type="email" placeholder="Indtast email">
<input class="login-input" type="password" placeholder="Indtast kodeord">
<button class="login-button">Send</button>
</form>
</div>
<picture>
<source media="(max-width:459px)" srcset="img/cow.jpg">
<source media="(min-width:460px)" srcset="img/dog.jpg">
<img src="/img/cow.jpg" alt="animals">
</picture>
</section>
<footer class="footer">
<div class="footer-content">
<p>Lorem ipsum dolor sit amet.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit quas beatae voluptate.</p>
Some other link
</div>
<div class="footer-content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Modi!</p>
<img class="logo-image" src="/rubbish" alt="">
</div>
</footer>
</main>
</body>
</html>
</html>

Flexbox layout with on column fluid and the other fixed width

On THIS page I have a layout with rows of text-photo pairs. I need the photo to have a fixed width and the text to have fluid width. The text has to be vertically centered. I have used flexbox to achieve these goals.
As can be seen below, in the list item with the id of box2, in order to place the photo to the left, I had to insert it before the text block in the DOM.
The problem: on small, mobile resolutions, when the display goes to block instead of flex, the photos of the first and second row are one after the other, when instead, there should be a block of text between them.
How can I fix that?
h3 {
max-width: 1000px;
margin: 0 auto;
padding: 65px 0;
font-size: 36px;
line-height: 1.2;
font-weight: 300;
font-family: "Open Sans", sans-serif;
}
ul.boxes {
list-style-type: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
}
ul.boxes li {
color: #3e3e3e;
display: flex;
flex-direction: row;
align-items: center;
}
ul.boxes #box1 {
background: #dcdcdc;
}
ul.boxes #box3 {
background: #6b6b6b;
color: #fff;
}
ul.boxes li .photo {
width: 402px;
max-width: 100%;
}
ul.boxes li .content {
padding: 0 65px;
width: 100%;
}
ul.boxes li h4 {
font-family: 'Oswald', sans-serif;
font-size: 16px;
margin-top: 0;
text-transform: uppercase;
}
ul.boxes li .content ul {
padding: 0;
}
ul.boxes li .content ul li {
padding-left: 20px;
background: transparent url('img/redbullet.png') no-repeat 5px 8px;
}
#media screen and (max-width: 480px) {
ul.boxes,
ul.boxes li {
display: block;
margin-bottom: 10px;
}
}
<h3 class="text-center thin">Obiectivul nostru este să fim în fiecare zi mai buni, iar munca noastră se bazează pe 3 piloni principali:
Calitate, Creativitate, Rezultate.</h3>
<ul class="boxes">
<li id="box1">
<div class="content">
<h4>Lorem ipsum dolor</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta, reiciendis molestias inventore blanditiis ratione amet, dolore id doloribus minus iure esse, accusantium qui ex, nesciunt? Officiis, animi saepe libero quae!</p>
</div>
<div class="photo flex-left">
<div class="photo flex-right">
<img src="http://placehold.it/402x335">
</div>
</div>
</li>
<li id="box2">
<div class="photo flex-right">
<img src="http://placehold.it/402x335">
</div>
<div class="content">
<h4>Lorem ipsum dolor</h4>
Descoperim continuu soluții noi pentru a ne îndeplini sarcinile și pentru a trece peste provocările zilnice, ca să fim în fiecare zi mai buni.
</div>
</li>
<li id="box3">
<div class="content">
<h4>Lorem ipsum dolor</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta, reiciendis molestias inventore blanditiis ratione amet, dolore id doloribus minus iure esse, accusantium qui ex, nesciunt? Officiis, animi saepe libero quae!</p>
</div>
<div class="photo flex-left">
<div class="photo flex-right">
<img src="http://placehold.it/402x335">
</div>
</div>
</li>
</ul>
Instead of display: block below (and including) 480px, you can wrap your flexbox and set order for the flex children like this:
ul.boxes,
ul.boxes li {
flex-wrap: wrap;
margin-bottom: 10px;
}
ul.boxes li .photo {
order: 2;
}
ul.boxes li .content {
order: 1;
}
I guess now you can take it forward from here - see demo below:
h3 {
max-width: 1000px;
margin: 0 auto;
padding: 65px 0;
font-size: 36px;
line-height: 1.2;
font-weight: 300;
font-family: "Open Sans", sans-serif;
}
ul.boxes {
list-style-type: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
}
ul.boxes li {
color: #3e3e3e;
display: flex;
flex-direction: row;
align-items: center;
}
ul.boxes #box1 {
background: #dcdcdc;
}
ul.boxes #box3 {
background: #6b6b6b;
color: #fff;
}
ul.boxes li .photo {
width: 402px;
max-width: 100%;
}
ul.boxes li .content {
padding: 0 65px;
width: 100%;
}
ul.boxes li h4 {
font-family: 'Oswald', sans-serif;
font-size: 16px;
margin-top: 0;
text-transform: uppercase;
}
ul.boxes li .content ul {
padding: 0;
}
ul.boxes li .content ul li {
padding-left: 20px;
background: transparent url('img/redbullet.png') no-repeat 5px 8px;
}
#media screen and (max-width: 480px) {
ul.boxes,
ul.boxes li {
flex-wrap: wrap;
margin-bottom: 10px;
}
ul.boxes li .photo {
order: 2;
}
ul.boxes li .content {
order: 1;
}
}
<h3 class="text-center thin">Obiectivul nostru este să fim în fiecare zi mai buni, iar munca noastră se bazează pe 3 piloni principali:
Calitate, Creativitate, Rezultate.</h3>
<ul class="boxes">
<li id="box1">
<div class="content">
<h4>Lorem ipsum dolor</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta, reiciendis molestias inventore blanditiis ratione amet, dolore id doloribus minus iure esse, accusantium qui ex, nesciunt? Officiis, animi saepe libero quae!</p>
</div>
<div class="photo flex-left">
<div class="photo flex-right">
<img src="http://placehold.it/402x335">
</div>
</div>
</li>
<li id="box2">
<div class="photo flex-right">
<img src="http://placehold.it/402x335">
</div>
<div class="content">
<h4>Lorem ipsum dolor</h4>
Descoperim continuu soluții noi pentru a ne îndeplini sarcinile și pentru a trece peste provocările zilnice, ca să fim în fiecare zi mai buni.
</div>
</li>
<li id="box3">
<div class="content">
<h4>Lorem ipsum dolor</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta, reiciendis molestias inventore blanditiis ratione amet, dolore id doloribus minus iure esse, accusantium qui ex, nesciunt? Officiis, animi saepe libero quae!</p>
</div>
<div class="photo flex-left">
<div class="photo flex-right">
<img src="http://placehold.it/402x335">
</div>
</div>
</li>
</ul>