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>
Related
I placed a 100% value in iframe, I am not sure how to fix this and I tried lower values and its locked at that size for some reason. I would like it to take up a larger size to fit the full game in its iframe.
I appreciate any help or solutions given in advance.
body {
font-family: "Gotham", sans-serif;
}
.gameScene {
height: 100%;
}
.Main {
height: 200%;
}
#Category {
font-family: "Gotham", sans-serif;
}
.fa-expand {
font-size: 1em;
color: white;
}
button:hover {
transform: scale(1.15);
filter: drop-shadow(4px 2px 4px black);
}
/* Scaling for all devices */
#media (max-width: 575px) {
.fa-gamepad, .fa-expand {
font-size: 16px;
}
}
#media (min-width: 576px) and (max-width: 767px) {
.fa-gamepad, .fa-expand {
font-size: 18px;
}
}
#media (min-width: 768px) and (max-width: 991px) {
.fa-gamepad, .fa-expand {
font-size: 20px;
}
}
#media (min-width: 992px) and (max-width: 1199px) {
.fa-gamepad, .fa-expand {
font-size: 22px;
}
}
#media (min-width: 1200px) {
.fa-gamepad, .fa-expand {
font-size: 24px;
}
}
<script src="https://kit.fontawesome.com/faea65eadf.js" crossorigin="anonymous"></script>
<link href="https://fonts.cdnfonts.com/css/gotham" rel="stylesheet">
<div class="GameHolder" style="display: flex; flex-direction: column;">
<iframe class="gameScene" src="https://snowrider3d.com/snow-rider-3d.embed" style="border: none; border-radius: 2em 2em 0em 0em;"></iframe>
<div style="background-color: #0f101e; border-radius: 0em 0em 2em 2em; display: flex; align-items: center; justify-content: space-between; padding: 10px 10px;">
<div style="display: flex; align-items: center;">
<img src="https://img.gamedistribution.com/3b79a8537ebc414fb4f9672a9b8c68c8-512x512.jpeg" style="width: 2.5em; height: 2.5em; border-radius: 1000000000000em">
<div style="margin-left: 10px;">
<h3 style="margin: 0.1em; color: White;">Snow Rider 3D</h3>
<p id="Category" style="margin: 0; background: #27211d; border-radius: 100em; width: max-content; padding: 0.3em; font-size: 12px; color: #ffc400;">Parkour</p>
</div>
</div>
<button style="transition: all 0.3s ease-in-out; padding: 1em; border: none; background-image: linear-gradient(#e23c03, #fa4e12); #ddd; border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;">
<i class="fas fa-expand" style="font-size: 20px; color: white;"></i>
</button>
</div>
</div>
I tried changing the div its contained in and nothing worked.
Please could somebody help me with flex for pushing my footer down / expanding the content to fit?
https://jsfiddle.net/9xjy78gj/
Hopefully it's clear to see from the site what my issue is.
I'd just like to use flex to push the footer down and expand the content div appropriately, without using set heights for the content div etc. if possible?
Many thanks!
HTML
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="page_wrap">
<header>
<a href="/">
<h1>Close<span><i class="fa fa-map-marker" aria-hidden="true"></i></span>Range</h1>
</a>
<hr />
</header>
<div id="refinement">
<form>
<div class="form_component">
<select id="narrow">
<option value="select" selected disabled>Please Select</option>
</select>
</div>
<div class="form_component">
<input id="driving" type="radio" name="travelmode" value="Driving" checked /> <i class="fa fa-car" aria-hidden="true"></i>
</div>
<div class="form_component">
<input id="walking" type="radio" name="travelmode" value="Walking" /> <i class="fa fa-male" aria-hidden="true"></i>
</div>
</form>
</div>
<div id="jquery_placeholder">
<!-- JQuery loads PHP output into here-->
</div>
<div id="place_results_wrap">
<!-- and here -->
<div id="content">
<h2>Let's explore!</h2>
<i class="fa fa-globe" aria-hidden="true"></i>
</div>
</div>
<footer class="footer">
<div id="google">
<img src="/assets/i/google.png" alt="Powered by Google" />
</div>
</footer>
</div>
</body>
</html>
CSS
a, a:hover
{
text-decoration: none;
}
body
{
font-family: 'Open Sans', sans-serif;
background: #ECECEA;
font-size:16px;
}
#page_wrap
{
width:100%;
}
header
{
background: #fff;
text-align: center;
padding: 1.250em;
}
header h1
{
font-size: 6em;
font-weight: 400;
color: #655e5e;
margin: 0;
display: inline-block;
}
#media screen and (max-width: 550px)
{
header h1 {
font-size: 3em;
}
}
header hr
{
max-width: 36em;
margin-bottom: 0px;
}
header .fa-map-marker
{
color: #ec3b3b;
font-size: 1.2em;
}
#refinement
{
padding: 0.5em 1.25em 1.25em;
display: flex;
align-items: center;
justify-content: center;
background: #fff;
}
#refinement form
{
display: flex;
justify-content: center;
}
.form_component
{
margin: 0 0.4em;
display: none;
}
.form_component i.fa
{
font-size: 1.4em;
color: #655e5e;
}
#content
{
text-align: center;
background: #655e5e;
padding: 1.25em;
}
#content h2
{
color: #fff;
font-weight: 400;
font-size: 4em;
margin: 0;
}
#media screen and (max-width: 415px) {
#content h2
{
font-size:2em;
}
}
#content i.fa-globe
{
font-size: 18em;
color: #fff;
}
.place_results
{
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
padding: 1.25em 0;
}
.next_page
{
padding: 0 1.250em;
width: 100%;
text-align: center;
}
.next_page button
{
background-color: #fff;
border: none;
color: #655e5e;
padding: 0.3125em 2em;
text-decoration: none;
display: inline-block;
font-size: 1em;
font-weight: 600;
cursor: pointer;
border-radius: 1.25em;
}
.next_page button:hover
{
background-color: #f6f6f6;
}
.place
{
width: 24em;
height: 27em;
margin: 1.25em;
display: flex;
flex-direction: column;
-webkit-box-shadow: 5px 6px 20px 0px rgba(158,155,158,0.75);
-moz-box-shadow: 5px 6px 20px 0px rgba(158,155,158,0.75);
box-shadow: 5px 6px 20px 0px rgba(158,155,158,0.75);
background: #fff;
}
#media screen and (max-width: 1920px) {
.place
{
width: 30%;
}
}
#media screen and (min-width: 900px)
and (max-width: 1366px){
.place
{
width: 45%;
}
}
#media screen and (min-width: 768px)
and (max-width: 1366px){
.place
{
width: 44%;
}
}
#media screen and (min-width: 415px)
and (max-width: 760px){
.place
{
width: 90%;
}
}
#media screen and (max-width: 415px) {
.place
{
width: 90%;
}
}
.place_image
{
width: 100%;
height: 14.0625em;
background-size: cover !important;
background-clip: content-box !important;
}
.place_description
{
padding: 0.625em;
display: flex;
flex-direction: column;
flex: 1 1 0;
background: #fff;
}
.distance_container p.distance
{
font-weight:600;
}
.place_description p, .place_description a
{
color: #655e5e;
font-weight: 400;
margin: 0;
}
.place_description .place_open p
{
margin: 0;
color: #49b51c;
}
.place_description i.fa
{
width: 1.25em;
}
.place_title
{
flex: 1 1 0;
}
.place_title h3
{
color: #655e5e;
font-weight: 600;
white-space: nowrap;
overflow: hidden;
margin: 0;
font-size: 1.4em;
line-height: 1.3;
}
#media screen and (max-width: 415px) {
.place_title h3
{
font-size: 1.2em;
}
}
.rating_container
{
width: 100%;
}
.rating_bar {
width: 6.875em;
height: 1.313em;
background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/2605/star-rating-sprite.png);
background-repeat: repeat-x;
background-position: 0 0;
}
.rating {
height: 1.313em;
background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/2605/star-rating-sprite.png);
background-position: 0 100%;
background-repeat: repeat-x;
}
.place_description .place_location
{
margin-bottom: 0.625em;
}
.place .distance_container, .place .vicinity_container, .place .place_phone_container
{
display: flex;
}
#load_container
{
padding: 1.25em;
text-align: center;
}
#load i.fa-spin
{
font-size: 4em;
color: #ec3b3b;
}
#jquery_placeholder
{
display:none;
width:100%;
}
footer
{
padding: 1.25em;
text-align: right;
background: #fff;
}
footer #google img
{
width: 10em;
}
#error
{
padding: 1.25em;
background: #ec3b3b;
}
#error p
{
font-size: 1.2em;
margin: 0;
color: #fff;
text-align: center;
}
#error i.fa-exclamation-circle
{
color: #fff;
}
Flexbox can do that providing you use flex-direction:column like so:
If you don't want sections to expand to take up spare space, just remove the flex:1.
html,
body {
height: 100%;
}
body {
min-height: 100%;
text-align: center;
/* for demo */
}
.page-wrap {
min-height: 100%;
display: flex;
flex-direction: column;
}
header {
background: pink;
}
footer {
background: rebeccapurple;
color: #fff;
}
aside {
flex: 1;
background: orange;
}
main {
flex: 1;
background: grey;
}
<div class="page-wrap">
<header>
<h1>Header</h1>
</header>
<aside>I'm a secondary header</aside>
<main>I'm main content</main>
<footer>
<h1>Footer</h1>
</footer>
</div>
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
I've incorporated media queries that work great for iPhones.
I am running into issues with viewing my website from a Motorola cell phone. I am not sure what the cause might be. Or if I need to add something extra in my code to accommodate other cell phone devices other than iPhone. I have the same media queries set for 320px and 425px...so all cell devices should be ok.
www.lewisdesigns.com. It works no problem on iPhone. This is why I am stumped why there would be issues for other mobile devices.
.box {
position:absolute;
border: 2px white dotted;
border-radius: 15px;
margin-top: 30px;
margin-right: auto;
margin-left: auto;
left:0;right:0;
width: 380px;
padding: 10px;
}
#media (max-width : 320px) {
.box { width: 240px;
margin-top: 15px;
}
}
#media (max-width : 425px) {
.box { width: 240px;
margin-top: 15px;
}
}
.nav-pills {
position: relative;
margin-top:265px;
display:table;
margin-left:auto;
margin-right:auto;
text-align:center;
}
.nav-pills li a {
color: black;
border-radius: 10px;
margin: 3px;
font-size: 15px;
font-weight: 589px;
border-radius:0px;
background-color: white;
display:inline-block;
}
.nav-pills li a:hover {
color: white;
background-color: transparent;
display:inline-block;
border: 1px white solid;
font-weight: 300;
}
#media (max-width : 320px) {
.nav-pills { width: 280px;
margin-top: 190px;
margin-bottom: 5px;
}
}
#media (max-width : 425px) {
.nav-pills { width: 280px;
margin-top: 210px;
margin-bottom: 20px;
}
}
#media (max-width : 320px) {
.nav-pills li a { font-size:12px;
padding: 8px;
margin:2px;
}
}
#media (max-width : 425px) {
.nav-pills li a { font-size:12px;
padding: 8px;
margin:2px;
}
}
.box h2 {
font: 70px/1.2 'Pacifico', Helvetica, sans-serif;
color: white;
text-shadow: 2px 2px 0px rgba(0,0,0,0.2), 4px 4px 8px rgba(0,0,0,0.2);
padding-right: 5px;
padding-left: 5px;
margin-left: 15px;
}
.box span {
margin-left: 70px;
}
#media (max-width : 320px) {
.box h2 { font: 50px/1.2 'Pacifico', Helvetica, sans-serif;
}
}
#media (max-width : 320px) {
.box span { margin-left: 40px;
}
}
#media (max-width : 425px) {
.box h2 { font: 50px/1.2 'Pacifico', Helvetica, sans-serif;
}
}
#media (max-width : 425px) {
.box span { margin-left: 40px;
}
}
<html>
<head>
<body>
<div class="header" id="header">
<div class="container">
<div class="box">
<h2>Lewis <br><span>Designs</span></h2>
</div>
<div class="menu">
<ul class="nav nav-pills">
<li>About</li>
<li>Consultations</li>
<li>Gallery</li>
<li>Contact</li>
</ul>
</div>
</div>
</div>
</body>
</head>
</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.