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

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.

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>

How to add additional sections to this timeline?

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

Media queries for higher resolutions

I am stucked with the resolution.
I am writing CSS for the following resolutions.
a. 800x600
b. 1024x768
c. 1280x800 and 1280x1024
d. 1366x768
e. 1920x1080
f. 2560x1440
And my laptop resolution is 1366*768, I have done CSS queries till there, but the problem arising now is how I write CSS for 1920*1080 and 2560*1440
I am testing the resolutions by changing the inspect element of chrome.
I have tried to code for 1920*1080, but it is only working if I am removing the code of 1366*768, means at a time only one code is running.
Here is my code of CSS:
#media only screen and (max-device-width: 800px) and (max-device-height: 600px){
.tab-menu
{
padding: 0px;
width: 16.2%;
margin-right: 1px !important;
}
.tab-menu a
{
font-size: 13px !important;
}
.main
{
width: 10%;
}
.other
{
width: 10%;
}
.sku
{
width: 10%;
}
.adjust-height
{
width: 100px;
}
.table
{
font-size: 13px;
}
.w-line
{
width : 9.2%;
}
.w-store
{
width: 9%;
}
.w-item{
width: 13.3%;
}
.w-item-name{
width:22.4%;
}
.w-qty
{
width: 10%;
}
.w-uom
{
width: 5%;
}
.w-price
{
width: 10%;
}
.w-total
{
width: 1.4%;
}
.w-blank
{
width: 2%;
}
}
#media all and (-ms-high-contrast:none) and (max-device-width: 800px) and (max-device-height: 600px) {
*::-ms-backdrop,.w-line {
width: 9%;
}
*::-ms-backdrop,.w-qty {
width: 9%;
}
*::-ms-backdrop,.w-price {
width: 10%;
}
}
#media only screen and (max-device-width: 1280px) and (max-device-height: 720px){
.bottom-grid
{
height: 130px;
}
.adjust-height
{
width: 130px;
}
#-moz-document url-prefix() {
.bottom-grid
{
height: 120px;
}
}
*::-ms-backdrop,.bottom-grid {
height: 121px;
}
}
#media only screen and (max-device-width: 1280px) and (max-device-height: 768px){
.adjust-height
{
width: 130px;
}
}
#media only screen and (max-device-width: 1920px) and (max-device-height: 1080px){
body
{
overflow-x: hidden;
}
.adjust-height
{
width: 200px;
}
.bottom-grid
{
height: 490px;
}
.tab-menu
{
width: 13.9%;
}
.foot-close
{
padding-right: 170px;
}
.tab-menu-left
{
padding-left:70px;
padding-right:65px;
}
.tab-menu-right
{
padding-left: 0px;
padding-right: 170px;
}
#-moz-document url-prefix() {
.bottom-grid
{
height: 480px;
}
}
*::-ms-backdrop,.bottom-grid {
height: 480px;
}
}
#media only screen and (max-device-width: 1366px) and (max-device-height: 768px) {
.adjust-height
{
width:137px;
transition: all 0.5s;
}
.tab-menu
{
width: 13.8%;
text-align: center;
margin-right:5px;
}
.tab-menu-left
{
padding-left:5px;
}
.tab-menu-right
{
padding-right:67px;
}
.bottom-grid
{
height:179px;
width:100%;
background-color: white;
overflow-y: scroll;
margin-left: 0px;
margin-right: 0px;
padding-left: 0px;
padding-right: 0px !important;
}
.w-img
{
width: 5%;
}
.w-line
{
width: 7.2%;
}
.w-store
{
width: 10.4%;
}
.w-item
{
width: 14.3%;
}
.w-item-name
{
width: 24.4%;
}
.w-qty
{
width: 10.2%;
}
.w-uom
{
width: 6%;
}
.w-price
{
width: 7.8%;
}
.w-total
{
width:7.6%;
}
#-moz-document url-prefix() {
.bottom-grid {
height:167px;
}
.w-qty
{
width: 10.9%;
}
}
#media all and (-ms-high-contrast:none)
{
*::-ms-backdrop,
.bottom-grid {
height: 165px;
margin-bottom: 0px;
} /* IE11 */
*::-ms-backdrop,.main-footer
{
}*::-ms-backdrop,.blue-band
{
font-size: 14px;
}
*::-ms-backdrop,.form-control
{
padding: 3px 6px;
}
*::-ms-backdrop,.select2-selection__arrow b
{
top:25% !important;
}
}
}
Thanks in advance...
When using 2 or more media queries, their order in the CSS matters.
Here is a "bigger first" solution, where body starts gray and change when screen gets smaller
Fiddle demo
body {
background: gray;
}
#media only screen and (max-width: 1000px) {
body {
background: red;
}
}
#media only screen and (max-width: 800px) {
body {
background: blue;
}
}
#media only screen and (max-width: 600px) {
body {
background: green;
}
}
Here is a "smaller first" solution, where body starts gray and change when screen gets bigger
Note, here is the order of the queries switched compared with above max-width rules
Fiddle demo
body {
background: gray;
}
#media only screen and (min-width: 600px) {
body {
background: green;
}
}
#media only screen and (min-width: 800px) {
body {
background: blue;
}
}
#media only screen and (min-width: 1000px) {
body {
background: red;
}
}
to target one reslotion (ex: 1024x768 ) you can use this following code.
#media(min-width:768px) and (max-width:1024px) {
/* enter your css for the super design !!! */
}
Hope, it help you !

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%;
}
}