How to add additional sections to this timeline? - html

I want to put a timeline in my website which I found on codepen.
The problem is, it has only three sections(semantic, relative, contained), I tried to add another two sections but the layout gets disrupted and loses responsiveness.
Could anyone guide me in creating extra sections in that timeline without loosing it's responsiveness?
HTML:
<!-- STEPS -->
<section id="Steps" class="steps-section">
<h2 class="steps-header">
Responsive Semantic Timeline
</h2>
<div class="steps-timeline">
<div class="steps-one">
<img class="steps-img" src="http://placehold.it/50/3498DB/FFFFFF" alt="" />
<h3 class="steps-name">
Semantic
</h3>
<p class="steps-description">
The timeline is created using negative margins and a top border.
</p>
</div>
<div class="steps-two">
<img class="steps-img" src="http://placehold.it/50/3498DB/FFFFFF" alt="" />
<h3 class="steps-name">
Relative
</h3>
<p class="steps-description">
All elements are positioned realtive to the parent. No absolute positioning.
</p>
</div>
<div class="steps-three">
<img class="steps-img" src="http://placehold.it/50/3498DB/FFFFFF" alt="" />
<h3 class="steps-name">
Contained
</h3>
<p class="steps-description">
The timeline does not extend past the first and last elements.
</p>
</div>
</div><!-- /.steps-timeline -->
</section>
CSS:
$outline-width: 0;
$break-point: 500px;
#import url(http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
body {
font-family: lato;
}
$gray-base: #999999;
$brand-primary: #3498DB; //Zen Blue
.section-header {
color: $brand-primary;
font-weight: 400;
font-size: 1.4em;
}
.steps-header {
#extend .section-header;
margin-bottom: 20px;
text-align: center;
}
.steps-timeline {
outline: 1px dashed rgba(red, $outline-width);
#media screen and (max-width: $break-point) {
border-left: 2px solid $brand-primary;
margin-left: 25px;
}
#media screen and (min-width: $break-point) {
border-top: 2px solid $brand-primary;
padding-top: 20px;
margin-top: 40px;
margin-left: 16.65%;
margin-right: 16.65%;
}
&:after {
content: "";
display: table;
clear: both;
}
}
.steps-one,
.steps-two,
.steps-three {
outline: 1px dashed rgba(green, $outline-width);
#media screen and (max-width: $break-point) {
margin-left: -25px;
}
#media screen and (min-width: $break-point) {
float: left;
width: 33%;
margin-top: -50px;
}
}
.steps-one,
.steps-two {
#media screen and (max-width: $break-point) {
padding-bottom: 40px;
}
}
.steps-one {
#media screen and (min-width: $break-point) {
margin-left: -16.65%;
margin-right: 16.65%;
}
}
.steps-two {
}
.steps-three {
#media screen and (max-width: $break-point) {
margin-bottom: -100%;
}
#media screen and (min-width: $break-point) {
margin-left: 16.65%;
margin-right: -16.65%;
}
}
.steps-img {
display: block;
margin: auto;
width: 50px;
height: 50px;
border-radius: 50%;
#media screen and (max-width: $break-point) {
float: left;
margin-right: 20px;
}
}
.steps-name,
.steps-description {
margin: 0;
}
.steps-name {
#extend .section-header;
#media screen and (min-width: $break-point) {
text-align: center;
}
}
.steps-description {
overflow: hidden;
#media screen and (min-width: $break-point) {
text-align: center;
}
}

Your CSS needs to be modified to include more divs within the same width. Now since the divs are manually assigned spacing between them rather than a dynamic approach, you can experimentally change the width and margin properties and including .step-four & .step-five in the css as well. I've included one additional div for example. You can try out adding more in this way.
CSS
$outline-width: 0;
$break-point: 500px;
#import url(http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
html {
box-sizing: border-box;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
body {
font-family: lato;
}
$gray-base: #999999;
$brand-primary: #3498DB; //Zen Blue
.section-header {
color: $brand-primary;
font-weight: 400;
font-size: 1.4em;
}
.steps-header {
#extend .section-header;
margin-bottom: 20px;
text-align: center;
}
.steps-timeline {
outline: 1px dashed rgba(red, $outline-width);
#media screen and (max-width: $break-point) {
border-left: 2px solid $brand-primary;
margin-left: 0px;
}
#media screen and (min-width: $break-point) {
border-top: 2px solid $brand-primary;
padding-top: 20px;
margin-top: 40px;
margin-left: 10%;
margin-right: 10%;
}
&:after {
content: "";
display: table;
clear: both;
}
}
.steps-one,
.steps-two,
.steps-three,
.steps-four,
.steps-five{
outline: 1px dashed rgba(green, $outline-width);
#media screen and (max-width: $break-point) {
margin-left: -25px;
}
#media screen and (min-width: $break-point) {
float: left;
width: 25%;
margin-top: -50px;
}
}
.steps-one,
.steps-two {
#media screen and (max-width: $break-point) {
padding-bottom: 40px;
}
}
.steps-one {
#media screen and (min-width: $break-point) {
margin-left: -12%;
margin-right: 12%;
}
}
.steps-two {}
.steps-three,.step-four{
#media screen and (max-width: $break-point) {
margin-bottom: -100%;
}
#media screen and (min-width: $break-point) {
margin-left: 10%;
margin-right: -10%;
float:right;
}
}
.steps-img {
display: block;
margin: auto;
width: 50px;
height: 50px;
border-radius: 50%;
#media screen and (max-width: $break-point) {
float: left;
margin-right: 10px;
}
}
.steps-name,
.steps-description {
margin: 0;
}
.steps-name {
#extend .section-header;
#media screen and (min-width: $break-point) {
text-align: center;
}
}
.steps-description {
overflow: hidden;
#media screen and (min-width: $break-point) {
text-align: center;
}
}
Depending on the number of divs, the width property of the following can be changed.
.steps-one,
.steps-two,
.steps-three,
.steps-four,
.steps-five{
outline: 1px dashed rgba(green, $outline-width);
#media screen and (max-width: $break-point) {
margin-left: -25px;
}
#media screen and (min-width: $break-point) {
float: left;
width: 25%;
margin-top: -50px;
}
}
For Example
3 divs - 33%
4 divs - 25%
5 divs - 20%
and so on

Related

How to make Navbar fully responsive for mobile. Nav-links missing. What am I doing wrong?

I'm trying to get my navbar fit on the screen when viewing on mobile. I can get the logo to shrink but I cannot get links to change size so that half of the navbar doesn't cut off.
Here is my Nav code followed by the css.
NAV
<nav class="navbar navbar-expand bg-dark">
<div class="container relative">
<ul class="navbar-nav mx-auto">
<li class="nav-item">
<a class="nav-link" href="/#portfolio">Portfolio</a>
</li>
<a href="{% url 'home' %}">
<img class="image-fluid" id="vswlogo" src="{% static 'images/Artboard_3.png' %}"/>
</a>
<li class="nav-item">
<a class="nav-link" href="{% url 'contact' %}">Contact</a>
</li>
</ul>
</div>
</nav>
CSS
#media screen and (max-width: 900px) {
body {
width: 100%;
}
}
#media screen and (max-width: 768px) {
body {
width: 100%;
}
}
#media screen and (max-width: 600px) {
body {
width: 100%;
}
}
#media screen and (max-width: 480px) {
body {
width: 100%;
}
}
#media screen and (max-width: 900px) {
#portfoliogrid1 {
width: 100%;
}
}
#media screen and (max-width: 768px) {
#portfoliogrid1 {
width: 100%;
}
}
#media screen and (max-width: 600px) {
#portfoliogrid1 {
width: 100%;
}
}
#media screen and (max-width: 480px) {
#portfoliogrid1 {
width: 100%;
}
}
#media screen and (max-width: 900px) {
#portfoliogrid2 {
width: 100%;
}
}
#media screen and (max-width: 768px) {
#portfoliogrid2 {
width: 100%;
}
}
#media screen and (max-width: 600px) {
#portfoliogrid2 {
width: 100%;
}
}
#media screen and (max-width: 480px) {
#portfoliogrid2 {
width: 100%;
}
}
/* Fonts */
#import url("https://fonts.googleapis.com/css2?family=Roboto:wght#100&display=swap");
h1 {
font-size: 50px;
text-align: center;
color: white;
}
h2 {
text-align: center;
font-size: 1.5em;
font-weight: bold;
color: white;
padding-top: px;
margin-bottom: -10px;
}
h3 {
text-align: center;
color: white;
}
p {
font-family: "Roboto", sans-serif;
font-weight: bold;
color: white;
}
/* MISC */
.container-banner {
margin: ;
}
hr {
color: white;
margin-bottom: 20px;
}
.banner-image {
text-align: center;
}
/* Body */
body {
background-image: url("{% static 'images/purple.jpg' %}");
padding: 15px;
font-family: "Roboto", sans-serif;
font-weight: bold;
background-repeat: no-repeat;
background-size: 100% 200%;
position: relative;
max-width: 100%;
}
html, body {
overflow-x: hidden;
}
/* Portfolio Columns & Images */
.arrow-down {
border: solid white;
border-width: 0 3px 3px 0;
display: inline-block;
padding: 3px;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
}
.arrow-center {
text-align: center;
}
#portfoliothumbnail {
width: 100%;
margin-bottom: 3px;
}
#portfoliogrid1 {
margin-right: -58px;
}
#portfoliogrid2 {
margin-left: -10px;
margin-right: -10px;
}
row {
margin: 8px -16px;
margin-bottom: 20px;
}
/* Navbar */
.navbar {
margin: -1% -1% 1% -1%;
padding: 30px;
}
.navbar .navbar-nav .nav-link {
color: #ffffff;
font-size: 1.7em;
}
.nav-link {
padding-top: 35px;
padding-left: 5px;
}
.navbar .navbar-nav .nav-link:hover {
color: #ffffff;
text-decoration: underline;
}
.navbar-logo-centered .navbar-nav .nav-link {
padding: 0.5em 1em;
}
.navbar img {
height: 100px;
padding-top: 10px;
padding-left: 40px;
padding-right: 40px;
top: -50px;
left: -35px;
display: block;
z-index: 999;
cursor: pointer;
-webkit-transition-property: all;
-webkit-transition-duration: 0.3s;
-webkit-transition-timing-function: ease;
}
#vswlogo:hover {
transform: scale(1.3);
}
Please excuse the amount of #media for my website body, I am still trying to filter out which one of them I need to keep and remove. If anyone has any ideas to what i'm missing or even doing wrong, i'd really appreciate to hear them. I'm still learning as you can tell.
I solved this for a standard mobile view by amending navbar-expand > navbar-expand-lg and adding #media code to center the nav-links and reduce font size. Still working on a fix for desktop view on mobile but I answered my own question above.

Div text & image responsive using css

I have the left & right columns, I want the image to be responsive when I minimize the screen & by default both left & right should cover the whole screen. when I minimize the screen the right image becomes small & when I check on the mobile device the left column is covering 80% of the screen. Please help me to fix the responsive image & what I'm missing. Below is my code.
div.container {
mc-grid-row: true;
margin-left: auto;
margin-right: auto;
display: flex;
flex-wrap: wrap;
justify-content: center;
width: 100%
}
div.box {
position: relative;
box-sizing: border-box;
margin-bottom: 0;
width: 50%;
min-width: 300px;
}
* {
box-sizing: border-box;
outline: 0;
padding: 0;
margin: 0;
}
body {
margin: 0;
}
.col-left{
background: #efefef;
box-shadow: 16px 0px 26px rgba(0, 0, 0, 0.3);
width:50%;
height:auto;
}
.col-right{
width:50%;
height:auto;
}
.col-right img {
width:100%;
height:auto;
background-repeat:no-repeat;
background-size:cover;
background-position:center center;
}
.container{
position:relative;
left:126px;
}
label {
display: inline-block;
max-width: 100%;
}
.container .main:after {
clear: both;
display: block;
content: '';
}
.main{
margin-left: 43px;
width: 547px;
height: 120px;
}
.content{
position:relative;
left: 126px;
margin-top:175px;
}
.text{
width: 547px;
height: 213px;
}
.title{
font-family: 'Inter';
font-style: italic;
font-weight: 300;
font-size: 36px;
line-height: 44px;
letter-spacing: 0.005em;
color: #FFFFFF;
}
.container{
margin-top:162px;
}
.author{
font-family: 'Inter-Regular';
font-style: normal;
font-weight: 600;
font-size: 28px;
line-height: 33px;
color: #FFFFFF;
margin-top:48px;
}
#media only screen and (min-width: 638px) and (max-width: 1334px) {
.title{
font-size:33px;
}
}
#media only screen and (min-width: 638px) and (max-width: 1251px) {
.title{
font-size:32px;
}
}
#media only screen and (min-width: 638px) and (max-width: 1171px) {
.title{
font-size:30px;
}
}
#media only screen and (min-width: 638px) and (max-width: 1130px) {
.title{
font-size:30px;
}
}
#media only screen and (min-width: 638px) and (max-width: 1056px) {
.title{
font-size:30px;
}
}
#media only screen and (min-width: 638px) and (max-width: 994px) {
.title{
font-size:30px;
}
}
#media only screen and (min-width: 638px) and (max-width: 987px) {
.title{
font-size:30px;
}
}
#media only screen and (min-width: 638px) and (max-width: 942px) {
.title{
font-size:30px;
}
}
#media only screen and (min-width: 638px) and (max-width: 838px) {
.title{
font-size:30px;
}
}
#media only screen and (min-width: 638px) and (max-width: 811px) {
.ls-title{
font-size: 18px;
width: 320px;
}
.title{
font-size:30px;
}
}
#media only screen and (min-width: 638px) and (max-width: 760px) {
.title{
font-size:30px;
}
}
#media only screen and (min-width: 638px) and (max-width: 709px) {
.title{
font-size:30px;
}
}
#media only screen and (min-width: 375px) and (max-width: 680px) {
.container .main:before {
width: 12px;
height: 64px;
}
.container{
left:40px;
}
.ls-logo-wrap{
left:40px;
}
.main{
margin-left:24px;
}
.content {
left: 40px;
margin-top: 43px;
}
.title{
font-size:18px;
width:280px;
line-height:28px;
}
.author{
margin-top:16px;
font-size:18px;
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="container">
<div class="col-left box">
<div class="container">
<div class="main">
<label class="title">textheretextherertexthere</label>
</div>
</div>
<div class="content">
<div class="text">
<label class="title">textheretextheretextheretextheretextheretexthere</label>
</div>
</div>
</div>
<div class="col-right box">
<img src="http://img.huffingtonpost.com/asset/scalefit_600_noupscale/56328113190000a600b9540d.jpeg" />
</div>
</div>
This code snippet will help you to solve your problem! check it out If you need any help let me know :)
I have noticed you were using the same classes "title" inside two different fields maybe it can impact your styling sometimes :)
Also, you were using a lot of media queries which were not needed as I believe. You can learn more about RWD here :)
https://css-tricks.com/a-complete-guide-to-css-media-queries/
.container {
display: flex;
/* flex-direction: row;
height: min-content; */
}
.box {
position: relative;
box-sizing: border-box;
margin-bottom: 0;
}
* {
box-sizing: border-box;
outline: 0;
padding: 0;
margin: 0;
}
body {
margin: 0;
}
.col-left{
background: black;
box-shadow: 16px 0px 26px rgba(0, 0, 0, 0.3);
width:50%;
}
.col-right{
width:50%;
height:auto;
}
.col-right img {
width:100%;
height:auto;
background-repeat:no-repeat;
background-size:cover;
background-position:center center;
}
label {
display: inline-block;
max-width: 100%;
}
.container .main:after {
clear: both;
display: block;
content: '';
}
.main{
text-align: center;
height: 120px;
}
.text{
text-align: center;
height: 213px;
}
.title{
font-family: 'Inter';
font-style: italic;
font-weight: 300;
font-size: 36px;
line-height: 44px;
letter-spacing: 0.005em;
color: #FFFFFF;
overflow-wrap: break-word;
padding: 5px;
}
.author{
font-family: 'Inter-Regular';
font-style: normal;
font-weight: 600;
font-size: 28px;
line-height: 33px;
color: #FFFFFF;
margin-top:48px;
}
#media (max-width: 800px)
{
.container{
flex-direction: column;
text-align: center;
align-items: center;
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="container">
<div class="col-left box">
<!-- here you have used the same class which is not a correct way to use -->
<div class="containers">
<div class="main">
<label class="title">textheretextherertexthere</label>
</div>
</div>
<div class="content">
<div class="text">
<label class="title">textheretextheretextheretextheretextheretexthere</label>
</div>
</div>
</div>
<div class="col-right box">
<img src="http://img.huffingtonpost.com/asset/scalefit_600_noupscale/56328113190000a600b9540d.jpeg" />
</div>
</div>

Media queries not working and also overriding regular css when It shouldn't

I'm having some issues implementing media queries. I just made all the media queries I need. But it seems that now when I'm testing it my normal view (desktop has also changed for some reason) and when I go to the first media queries size. I can see that some elements like #taglineand #login-form are not adopted from the media queries but from a smaller size media queries same goes for normal view. They both adopted changes from this size #media only screen and (min-height: 768px) and (min-width: 1024px) instead of the things I specified for it. I don't understand what is going wrong here
regular scss:
#login-container {
height: 100%;
width: 100%;
display: flex;
flex-direction: row;
#side {
width: 30%;
background-color: $plain-white;
display: flex;
flex-direction: column;
padding: 20px;
border-right: 1px solid #ECECEC;
#side-caption {
width: 80%;
margin: 100px auto;
#appoint-full-logo {
width: 80%;
}
#tagline {
margin-top: -30px;
color: rgba(2, 159, 157, 1);
font-weight: 500;
font-size: 1.73em;
}
}
}
#login {
width: 70%;
height: 100%;
background-color: rgba(2, 159, 157, 1);
#login-form {
height:80% ;
width:80% ;
background-color: $plain-white;
margin: 130px auto;
border-radius: 5px;
display: flex;
flex-direction: column;
div {
height: 20%;
#welcome {
text-align: center;
font-weight: 550;
font-size: 2.5em;
margin-top: 50px !important;
color: #E8A87C;
}
}
#apply-text {
height: 15%;
font-size: 0.9em;
width: 70%;
margin: auto;
font-weight: 500;
// text-align: center;
}
#apply-form-fields,
#login-form-fields {
height: 45%;
display: flex;
flex-direction: column;
margin-left: 16%;
:first-child {
margin-top: 10px;
}
.form-group {
margin: 10px 0px;
width: 80%;
label {
font-weight: 500;
}
}
}
#apply-submited {
height: 10%;
width: 70%;
margin: auto;
p {
background-color: rgba(85, 255, 214, 0.50);
padding: 10px;
text-align: center;
font-weight: 600;
border-radius: 5px;
;
}
}
.button-field {
height: 20%;
.button {
cursor: pointer;
width: 70%;
height: 40%;
color: $white;
font-size: 1.1em;
margin: 10px auto;
background-color: #E8A87C;
border: none;
padding: 10px;
font-weight: 600;
border: solid 5px #E8A87C;
border-radius: 5px;
text-align: center;
&:hover {
color: #E27D60;
}
}
.change-form {
cursor: pointer;
text-align: center;
span {
font-weight: 600;
}
&:hover span {
color: #E8A87C;
}
}
}
}
}
}
Media queries located at bottom of style cheat
set media queries:
#media only screen and (min-width: 1366px) and (min-height: 1024px) {
#tagline {
margin-top: -17px !important;
font-size: 1.52em !important;
}
}
#media only screen and (min-width: 1024px)and (min-height: 1366px) {
#tagline {
margin-top: -17px !important;
font-size: 1.05em !important;
}
#appoint-full-logo {
width: 100% !important;
}
}
#media only screen and (min-width: 1024px)and (min-height: 768px) {
#tagline {
margin-top: -15px !important;
font-size: 1.05em !important;
}
#appoint-full-logo {
width: 100% !important;
}
#login-form {
width: 60% !important;
height: 80% !important;
margin-top: 110px !important;
}
#welcome {
font-size: 2em !important;
}
}
#media only screen and (min-width: 768px)and (min-height:1024px) {
#tagline {
margin-top: -10px !important;
font-size: 0.76em !important;
}
#appoint-full-logo {
width: 105% !important;
}
#login-form {
width: 80% !important;
height: 60% !important;
margin-top: 110px !important;
}
#welcome {
font-size: 1.9em !important;
}
}
1.
#media only screen and (min-height: 768px) and (min-width: 1024px) --- perhaps your window/browser height is Below 768px
2.
The ! IMPORTANT -flag often causes problems in code
3.
Your code in media-queries.scss should be nested in the same way
regular.scss is nested too
You might be overusing the !important keyword. When you’re using it, it states any other rule is overridden. Since the smaller media queries are what are looked at/executed first when the media query is set to min-width or min-height, you are probably instructing css to say “I see there are larger media queries, but I’ve been instructed by a smaller media query to honor its rules first and for most.
The CSS inside you media queries needs to be nested exactly like in your regular style rules.
Otherwise they get assigned more importance.
You might check this Codepen out.
#container {
#color {
height: 50vh;
background-color: red;
}
}
#container2 {
#color2 {
height: 50vh;
background-color: blue;
}
}
#media (min-width: 768px) {
/* not affected by querie */
#color {
height: 50vh;
background-color: blue;
}
/* affected by querie */
#container2 {
#color2 {
background-color: green;
}
}
}
<div id="container">
<div id="color"></div>
</div>
<div id="container2">
<div id="color2"></div>
</div>

I would like to make this responsive timeline to have 6 steps

I need 6 steps. I tried for hours, I just can't make it work. I'm pretty sure it's not that hard for someone more experienced. I've had several forks but all are dead end.
Could you help me out please?
http://codepen.io/kjohnson/pen/azBvaE
HTML:
<section id="Steps" class="steps-section">
<h2 class="steps-header">
Responsive Semantic Timeline
</h2>
<div class="steps-timeline">
<div class="steps-one">
<img class="steps-img" src="http://placehold.it/50/3498DB/FFFFFF" alt="" />
<h3 class="steps-name">
Semantic
</h3>
<p class="steps-description">
The timeline is created using negative margins and a top border.
</p>
</div>
<div class="steps-two">
<img class="steps-img" src="http://placehold.it/50/3498DB/FFFFFF" alt="" />
<h3 class="steps-name">
Relative
</h3>
<p class="steps-description">
All elements are positioned realtive to the parent. No absolute positioning.
</p>
</div>
<div class="steps-three">
<img class="steps-img" src="http://placehold.it/50/3498DB/FFFFFF" alt="" />
<h3 class="steps-name">
Contained
</h3>
<p class="steps-description">
The timeline does not extend past the first and last elements.
</p>
</div>
</div><!-- /.steps-timeline -->
CSS:
#import url(http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
body {
font-family: lato;
}
.section-header, .steps-header, .steps-name {
color: #3498DB;
font-weight: 400;
font-size: 1.4em;
}
.steps-header {
margin-bottom: 20px;
text-align: center;
}
.steps-timeline {
outline: 1px dashed rgba(255, 0, 0, 0);
}
#media screen and (max-width: 500px) {
.steps-timeline {
border-left: 2px solid #3498DB;
margin-left: 25px;
}
}
#media screen and (min-width: 500px) {
.steps-timeline {
border-top: 2px solid #3498DB;
padding-top: 20px;
margin-top: 40px;
margin-left: 16.65%;
margin-right: 16.65%;
}
}
.steps-timeline:after {
content: "";
display: table;
clear: both;
}
.steps-one,
.steps-two,
.steps-three {
outline: 1px dashed rgba(0, 128, 0, 0);
}
#media screen and (max-width: 500px) {
.steps-one,
.steps-two,
.steps-three {
margin-left: -25px;
}
}
#media screen and (min-width: 500px) {
.steps-one,
.steps-two,
.steps-three {
float: left;
width: 33%;
margin-top: -50px;
}
}
#media screen and (max-width: 500px) {
.steps-one,
.steps-two {
padding-bottom: 40px;
}
}
#media screen and (min-width: 500px) {
.steps-one {
margin-left: -16.65%;
margin-right: 16.65%;
}
}
#media screen and (max-width: 500px) {
.steps-three {
margin-bottom: -100%;
}
}
#media screen and (min-width: 500px) {
.steps-three {
margin-left: 16.65%;
margin-right: -16.65%;
}
}
.steps-img {
display: block;
margin: auto;
width: 50px;
height: 50px;
border-radius: 50%;
}
#media screen and (max-width: 500px) {
.steps-img {
float: left;
margin-right: 20px;
}
}
.steps-name,
.steps-description {
margin: 0;
}
#media screen and (min-width: 500px) {
.steps-name {
text-align: center;
}
}
.steps-description {
overflow: hidden;
}
#media screen and (min-width: 500px) {
.steps-description {
text-align: center;
}
}
I assume you want something like this?
http://codepen.io/adamk22/pen/LGQQKz
$outline-width: 0;
$break-point: 500px;
#import url(http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
body {
font-family: lato;
}
$gray-base: #999999;
$brand-primary: #3498DB; //Zen Blue
.section-header {
color: $brand-primary;
font-weight: 400;
font-size: 1.4em;
}
.steps-header {
#extend .section-header;
margin-bottom: 20px;
text-align: center;
}
.steps-timeline {
outline: 1px dashed rgba(red, $outline-width);
#media screen and (max-width: $break-point) {
border-left: 2px solid $brand-primary;
margin-left: 25px;
}
#media screen and (min-width: $break-point) {
border-top: 2px solid $brand-primary;
padding-top: 20px;
margin-top: 40px;
margin-left: 8%;
margin-right: 8%;
}
&:after {
content: "";
display: table;
clear: both;
}
}
.steps-one,
.steps-two,
.steps-three,
.steps-four,
.steps-five,
.steps-six{
outline: 1px dashed rgba(green, $outline-width);
#media screen and (max-width: $break-point) {
margin-left: -25px;
}
#media screen and (min-width: $break-point) {
float: left;
width: 12%;
margin-top: -50px;
}
}
.steps-one,
.steps-two,
.steps-three,
.steps-four,
.steps-five,
.steps-six{
#media screen and (max-width: $break-point) {
padding-bottom: 40px;
}
}
.steps-one {
#media screen and (min-width: $break-point) {
margin-left: -8%;
margin-right: 8%;
}
}
.steps-two {
#media screen and (min-width: $break-point) {
margin-right: 8%;
}
}
.steps-three {
#media screen and (min-width: $break-point) {
margin-right: 8%;
}
}
.steps-four {
#media screen and (min-width: $break-point) {
margin-right: 8%;
}
}
.steps-five {
}
.steps-six {
#media screen and (max-width: $break-point) {
margin-bottom: -100%;
}
#media screen and (min-width: $break-point) {
margin-left: 8%;
margin-right: -8%;
}
}
.steps-img {
display: block;
margin: auto;
width: 50px;
height: 50px;
border-radius: 50%;
#media screen and (max-width: $break-point) {
float: left;
margin-right: 20px;
}
}
.steps-name,
.steps-description {
margin: 0;
}
.steps-name {
#extend .section-header;
#media screen and (min-width: $break-point) {
text-align: center;
}
}
.steps-description {
overflow: hidden;
#media screen and (min-width: $break-point) {
text-align: center;
}
}
Most of the changes require you to change the CSS, especially the media queries as you can see in the pen.

Not able to float div correctly

I have a list with 3 blocks each taking 33% normally. When I resize the window to smaller size I would like the first two blocks to be stacked one above the other and take 50% of the width while the third element to span and take the other 50% on the whole but I am only able to span first two blocks in first row and third block in 2nd row.
And on minimizing it further, I would like all of them to be stacked one below the other.
I have added the layouts:
Here is my code:
li.listChild .time-home {
float: left;
height: auto;
width: 100%;
line-height: 21px;
font-size: 12px;
font-weight: 700;
text-align: right;
}
#media only screen and (min-width: 800px) and (max-width: 1023px) {
li.listChild .time-home {
width: 100%; }
}
li.listChild .time-home .listItem {
float: left; }
li.listChild .time-home .listItem.datum-home {
width: 33%;
font-weight: 700; }
#media only screen and (min-width: 1024px) and (max-width: 1443px) {
li.listChild .time-home .listItem.datum-home {
width: 50%;
border-bottom: 1px #e8e8e8 solid; }
}
#media only screen and (min-width: 800px) and (max-width: 1023px) {
li.listChild .time-home .listItem.datum-home {
width: 100%;
border-bottom: 1px #e8e8e8 solid; }
}
li.listChild .time-home .listItem.zeit-home {
font-weight: 400;
width: 33%;
}
#media only screen and (min-width: 1024px) and (max-width: 1443px) {
li.listChild .time-home .listItem.zeit-home {
width: 50%;
border-bottom: 1px #e8e8e8 solid; }
}
#media only screen and (min-width: 800px) and (max-width: 1023px) {
li.listChild .time-home .listItem.zeit-home {
width: 100%;
border-bottom: 1px #e8e8e8 solid; }
}
li.listChild .time-home .listItem.type-home {
width: 33%;
color: #0293ed;
border: none;
font-weight: 700;
}
#media only screen and (min-width: 1024px) and (max-width: 1443px) {
li.listChild .time-home .listItem.type-home {
width: 100%;
border-bottom: 1px #e8e8e8 solid;
border-right: 1px #e8e8e8 solid; }
}
#media only screen and (min-width: 800px) and (max-width: 1023px) {
li.listChild .time-home .listItem.type-home {
width: 100%;
border-bottom: 1px #e8e8e8 solid;
border-right: 1px #e8e8e8 solid; }
}
<li class="listChild">
<div class="time">
<div class="listItem datum">
3.6.93
</div>
<div class="listItem zeit">
4.6.93
</div>
<div class="listItem type">
Thomas
</div>
</div>
</li>
You don't necessarily need to use flexbox, you could use absolute positioning.
Example: https://jsfiddle.net/yyuwmv1r/
* {
box-sizing: border-box;
}
.container {
height: 300px;
width: 100%;
position: relative;
}
.one,
.two,
.three {
border: 2px solid black;
height: 33.33%;
width: 100%;
float: left;
background: red;
}
.two {
background: blue;
}
.three {
background: green;
}
#media only screen and (min-width: 800px) and (max-width: 1200px) {
.one,
.two,
.three {
position: absolute;
}
.one {
top: 0;
left: 0;
height: 50%;
width: 50%;
}
.two {
top: 50%;
left: 0;
height: 50%;
width: 50%;
}
.three {
top: 0;
left: 50%;
height: 100%;
width: 50%;
}
}
#media only screen and (min-width: 1200px) {
.one,
.two,
.three {
border: 2px solid black;
height: 100%;
width: 33.33%;
float: left;
background: red;
}
.two {
background: blue;
}
.three {
background: green;
}
}
<div class="container">
<div class="one">
One
</div>
<div class="two">
Two
</div>
<div class="three">
Three
</div>
</div>
You can do this with Flexbox and media queries
DEMO
.div-1, .div-2, .div-3 {
border: 1px solid black;
}
.content {
display: flex;
flex-direction: row;
min-height: 100vh;
}
.group {
flex: 2;
display: flex;
}
.div-3, .div-1, .div-2 {
flex: 1;
}
#media(max-width: 992px) {
.group {
flex-direction: column;
}
}
#media(max-width: 480px) {
.content {
flex-direction: column;
}
}
<div class="content">
<div class="group">
<div class="div-1">Div 1</div>
<div class="div-2">Div 2</div>
</div>
<div class="div-3">Div 3</div>
</div>
Drag the output left and right to simulate media queries. Keep in mind I didn't abide by your media queries, was using my own only to simulate the example.
Fiddle here
<li class="listChild">
<div class="time">
<div class="some-container">
<div class="listItem datum">
list one
</div>
<div class="listItem zeit">
list two
</div>
</div>
<div class="listItem type">
list three
</div>
</div>
</li>
* {
box-sizing: border-box;
}
.listItem {
border: 1px solid #000;
padding: 10px;
float: left;
width: 250px;
height: 30px;
}
.some-container {
float: left;
}
.some-container + .listItem {
float: left;
}
#media (max-width: 800px) and (min-width: 300px) {
.some-container .listItem {
height: 30px;
float: none;
}
.some-container + .listItem {
height: 60px;
}
}
#media (max-width: 299px) {
.listItem {
float: none;
width: 100%;
}
}