I'm using Twitter bootstrap for an application that makes a CSS football field. I had originally built the application by downloading and dropping in Twitter bootstrap into my application. However, to take advantage of LESS, I then created a new application where I installed Twitter bootstrap with the gem for Rails applications. In this new application, if I change the size of the browser, the football fields dimensions will change (and it looks awful). In the old application, I could resize the browser and the field would stay the same. So far, the CSS I'm using is exactly the same (i.e. I haven't included any LESS into this new application) and the HTML is also the same, therefore, I'm not really sure what code if any to include in this question. From what I've told you can you tell me what has happened and how I can prevent the resizing?
Here's the code for the football field, although since it worked in my original application I don't know if changing anything with this markup will make a difference, but the layout hasn't otherwise changed either.
Note, I like the idea of a responsive website, however, I need the football field to stay the same size, so if there's something that can be done to it with css to ensure that it doesn't resize I'd be satisfied.
<div class="span3 field">
<div class="row endzonenorth">
</div>
<div class="row field">
<span class="qb"></span>
<div class="horizontalRule">
<span class="funnyzone"> END ZONE</span>
</div>
<div class="horizontalRule">
<div class="number right">10</div>
<div class="number left">10</div>
</div>
<div class="horizontalRule">
<div class="number right">20</div>
<div class="number left">20</div>
</div>
<div class="horizontalRule">
<div class="number right">30</div>
<div class="number left">30</div>
</div>
<div class="horizontalRule">
<div class="number right">40</div>
<div class="number left">40</div>
</div>
<div class="horizontalRule">
<div class="number right">50</div>
<div class="number left">50</div>
</div>
<div class="horizontalRule">
<div class="number right">40</div>
<div class="number left">40</div>
</div>
<div class="horizontalRule">
<div class="number right">30</div>
<div class="number left">30</div>
</div>
<div class="horizontalRule">
<div class="number right">20</div>
<div class="number left">20</div>
</div>
<div class="horizontalRule">
<div class="number right">10</div>
<div class="number left">10</div>
</div>
<div class="horizontalRule">
<span class="funnyzonesouth">END ZONE</span>
</div>
</div>
<div class="row endzonesouth">
</div>
</div>
CSS:
div.horizontalRule
{
clear:both;
width:100%;
background-color:#fff;
height:1px;
margin-top:30px;
margin-bottom:30px;
display: block;
opacity: .75;
}
.number.right{
color: #fff;
position: absolute;
right: 40px;
margin-top: -10px;
}
.number.left{
color: #fff;
position: absolute;
left: 40px;
margin-top: -10px;
}
.funnyzone{
opacity: .75;
/*top: 7px;*/
position: absolute;
color: #fff;
font-size: 22px;
margin-top: -25px;
margin-left: 15px;
}
.funnyzonesouth{
font-size: 22px;
color: #fff;
opacity: .75;
margin-top: 4px;
margin-left: 40px;
/*bottom: -3px;*/
position: absolute;
transform:rotate(180deg);
-ms-transform:rotate(180deg); /* IE 9 */
-moz-transform:rotate(180deg); /* Firefox */
-webkit-transform:rotate(180deg); /* Safari and Chrome */
-o-transform:rotate(180deg); /* Opera */
}
.span3.field{
background-color: rgb(96, 211, 43);
}
.row.field{
width: 90%;
background-color: #56a636;
position: relative;
margin-left: auto;
margin-right: auto;
}
.row.endzonenorth{
width: 90%;
height: 25px;
background-color: #56a636;
color: #fff;
font-size: 22px;
margin-left: auto;
margin-right: auto;
}
.row.endzonesouth{
width: 90%;
height: 25px;
background-color: #56a636;
color: #fff;
font-size: 24px;
margin-left: auto;
margin-right: auto;
}
.row.endzone{
height: 30px;
background-color: #56a636;
}
.line {
color: white;
display: block;
padding-top: 10px;
padding-bottom: 10px;
opacity: 0.55,
}
.linea{
padding-top: 10px;
padding-bottom: 10px;
color: white;
display:block;
}
.leftvertical {
width:1px;
height:410px;
background-color:#fff;
opacity: .55;
position: absolute;
left:50px;
}
.rightvertical {
width:1px;
height:410px;
background-color:#fff;
opacity: .55;
position: absolute;
right:50px;
}
.number.left
{
transform:rotate(90deg);
-ms-transform:rotate(90deg); /* IE 9 */
-moz-transform:rotate(90deg); /* Firefox */
-webkit-transform:rotate(90deg); /* Safari and Chrome */
-o-transform:rotate(90deg); /* Opera */
}
.number.right
{
transform:rotate(270deg);
-ms-transform:rotate(270deg); /* IE 9 */
-moz-transform:rotate(270deg); /* Firefox */
-webkit-transform:rotate(270deg); /* Safari and Chrome */
-o-transform:rotate(270deg); /* Opera */
}
.row.endzone{
width: 90%;
}
.row.endzone2{
width: 90%;
}
.qb{
position: absolute;
width: 50px;
height: 50px;
background-image: url('/assets/qb.png');
/*background-color: #fff;*/
left: 75px;
top: 300px;
visibility:hidden;
}
.span4.offset4{
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
font-size: 25px;
font-weight: bold;
min-height: 30px;
text-align: center;
/*width: 100%;*/
display: inline-block;
}
.row.main{
padding-top: 20px;
}
.span6.offset2{
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
/*font-size: 25px;*/
padding-top: 10px;
font-size: 16px;
font-weight: bold;
min-height: 30px;
text-align: center;
/*width: 100%;*/
display: inline-block;
}
you seem to be using relative width sizes, ie 100%. instead try using absolute widths ie 500px; alternatively, try setting a width for your container.
.span3.field{
width:500px;
background-color: rgb(96, 211, 43);
}
hope this is of some help..
Related
I am making a website and I have chosen to use smooth scroll.
The smooth scrolling effect works, but if (for example) i chose to scroll down to the 'timeline' section, and then scroll back to 'home', it just stops scrolling midway through the home section. Why is this? Below you can see my webiste.
For example I have set this div as section1 (home):
<div id='section1' class="home-info">
Therefore, i thought that smoothscroll would take me to the top of that div. Turns out it only scrolls through half of it. Why is that???
*{
margin: 0;
padding: 0;
font-family: Arial, Helvetica, sans-serif;
}
html {
scroll-behavior: smooth;
}
a {
color: #AEC6CF;
underline: black;
}
.header{
height: 100px;
background: #f1f1f1;
padding: 0 20px;
color: #000000;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1030;
}
.logo{
line-height: 100px;
float: left;
position: fixed;
top: 0;
z-index: 1030;
}
.menu{
float: right;
line-height: 100px;
position: fixed;
right: 0;
top: 0;
z-index: 1030;
font-size: 20px;
}
.menu a{
color: #000000;
text-decoration: none;
padding: 0 10px;
transition: 0.4s;
}
.show-menu-btn,.hide-menu-btn{
transition: 0.4s;
font-size: 30px;
cursor: pointer;
display: none;
}
.show-menu-btn{
float: right;
}
.show-menu-btn i{
line-height: 100px;
}
.menu a:hover,
.show-menu-btn:hover,
.hide-menu-btn:hover {
color: #AEC6CF;
}
a:link, i {
color: black;
}
i:hover {
color: #AEC6CF;
transition: 0.4s;
cursor: pointer;
}
#chk{
position: absolute;
visibility: hidden;
z-index: -1111;
}
.footer {
left: 0;
bottom: 0;
width: 100%;
background-color: #f1f1f1;
color: black;
text-align: center;
padding-top: 25px;
padding-bottom: 25px;
}
#media screen and (max-width:800px) {
.show-menu-btn,.hide-menu-btn{
display: block;
}
.menu{
position: fixed;
width: 100%;
height: 100vh;
background: #f1f1f1;
right: -100%;
top: 0;
text-align: center;
padding: 80px 0;
line-height: normal;
transition: 0.7s;
}
.menu a{
display: block;
padding: 20px;
}
.hide-menu-btn{
position: absolute;
top: 40px;
right: 40px;
}
#chk:checked ~ .menu{
right: 0;
}
.footer {
left: 0;
bottom: 0;
width: 100%;
background-color: #f1f1f1;
color: black;
text-align: center;
padding-top: 25px;
padding-bottom: 25px;
padding-left: 10px;
padding-right: 10px;
}
.header {
height: 103.5px;
}
.header-info h2 {
font-size: 20px;
margin-top: 350px;
}
.header-info h1 {
font-size: 30px;
}
}
* {
box-sizing: border-box;
}
body {
background-color: #fff;
font-family: Helvetica, sans-serif;
}
/* The actual timeline (the vertical ruler) */
.timeline {
position: relative;
max-width: 1200px;
margin: 0 auto;
}
/* The actual timeline (the vertical ruler) */
.timeline::after {
content: '';
position: absolute;
width: 4px;
background-color: black;
top: 0;
bottom: 0;
left: 50%;
margin-left: -1.2px;
}
/* Container around content */
.container {
padding: 10px 40px;
position: relative;
background-color: inherit;
width: 50%;
}
.header-container {
width: 100%;
position: relative;
background-color: inherit;
padding: 10px 40px;
}
/* The circles on the timeline */
.container::after {
content: '';
position: absolute;
width: 25px;
height: 25px;
right: -17px;
background-color: white;
border: 4px solid #AEC6CF;
top: 15px;
border-radius: 50%;
z-index: 1;
}
/* Place the container to the left */
.left {
left: 0;
}
/* Place the container to the right */
.right {
left: 50%;
}
/* Add arrows to the left container (pointing right) */
.left::before {
content: " ";
height: 0;
position: absolute;
top: 22px;
width: 0;
z-index: 1;
right: 30px;
border: medium solid white;
border-width: 10px 0 10px 10px;
border-color: transparent transparent transparent white;
}
/* Add arrows to the right container (pointing left) */
.right::before {
content: " ";
height: 0;
position: absolute;
top: 22px;
width: 0;
z-index: 1;
left: 30px;
border: medium solid white;
border-width: 10px 10px 10px 0;
border-color: transparent white transparent transparent;
}
/* Fix the circle for containers on the right side */
.right::after {
left: -16px;
}
/* The actual content */
.content {
padding: 20px 30px;
background-color: #f1f1f1;
position: relative;
border-radius: 6px;
transition: 0.4s;
}
/* Media queries - Responsive timeline on screens less than 600px wide */
#media screen and (max-width: 600px) {
/* Place the timelime to the left */
.timeline::after {
left: 31px;
}
/* Full-width containers */
.container {
width: 100%;
padding-left: 70px;
padding-right: 25px;
}
/* Full-width containers */
.header-container {
width: 100%;
padding-left: 25px;
padding-right: 25px;
}
/* Make sure that all arrows are pointing leftwards */
.container::before {
left: 60px;
border: medium solid white;
border-width: 10px 10px 10px 0;
border-color: transparent white transparent transparent;
}
/* Make sure all circles are at the same spot */
.left::after, .right::after {
left: 15px;
}
/* Make all right containers behave like the left ones */
.right {
left: 0%;
}
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='stylesheet' href='style.css'>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css">
</head>
<body>
<title>lunAr-creator</title>
<div class="header" id='pronav'>
<div class='logo' id='logo'>
<h1>lunAr-creator</h1>
</div>
<input type="checkbox" id="chk">
<label for="chk" class="show-menu-btn">
<i class="fas fa-bars"></i>
</label>
<ul class="menu" id='navbar'>
Home
About
Timeline
Projects
Useful Links
<label for="chk" class="hide-menu-btn">
<i class="fas fa-times"></i>
</label>
</ul>
</div>
<div style="margin-top:120px">
<div id='section1' class="home-info">
<h2 style='text-align:center;margin-top:350px;font-size:28px;'>Hi there. I'm lunAr-creator!</h2>
<h1 style='text-align:center;padding-top:20px;font-size:40px;love {color:#AEC6CF}'>& I love programming</h1>
<h3 style='text-align:center;padding-top:30px;padding-bottom:480px;'>Projects<i class="fas fa-chevron-down" style='margin-left:20px;'></i></h3>
</div>
<div class='header-container'>
<div id="section3" class="content">
<h2>About<i style='margin-left:20px;color:#AEC6CF;cursor:default;' class="fas fa-address-card"></i></h2>
<p>This is where i will talk about who I am and what i do :D</p>
</div>
</div>
<div class='header-container'>
<div class="content">
<h2>Timeline<i style='margin-left:20px;color:#AEC6CF;cursor:default;padding-bottom:0px;' class="fas fa-child"></i></h2>
<p>The stages I have been through so far with programming.</p>
</div>
</div>
<br></br>
<div class="timeline">
<div class="container right">
<div class="content">
<h2>2016 - 17</h2>
<p>I joined a Scratch coding camp where I learnt some of the foundations of programming.</p>
<br></br>
<p>My Dad built on the knowledge I had already aquired from the course and used C# to teach us some new concepts.</p>
</div>
</div>
<div class="container left">
<div class="content">
<h2>2018-19</h2>
<p>My school introduced me to HTML and CSS where i made my first website - a Minecraft handbook. I started learning Python aswell after it being recommended to me.</p>
<p>Watched a couple of Youtube tutorials on Python, started applying them to small programs and building up my skills.</p>
<br></br>
<p>Made my first (text-based) game called '9-lives'. Used the book: 'Python in easy steps' to help me understand the logic behind it.</p>
</div>
</div>
<div class="container right">
<div class="content">
<h2>2020</h2>
<p>Had lots of spare time on my hands due to Covid. Made some projects such as pong, a simple email client using smtplib, tkinter for the UI and made my second website.</p>
<br></br>
<p>Developed and hosted (and is still hosting) a website for a youth group. I used HTML, CSS and a little Javascript to accomplish this.</p>
<a style='color: #AEC6CF' href="https://a-town-youth.netlify.app">Click here to visit the youth group website</a>
</div>
</div>
<div class="container left">
<div class="content">
<h2>2021</h2>
<p>Created a text-based adventure rpg game for beginners to contribute to (including me). In my opinion it improved my team-working/collaboration skills and helped me learn some new concepts looking at other people code.</p>
<br></br>
<p>Joined GitHub :D </p>
<a style='color: #AEC6CF' href="https://github.com/lunAr-creator">Click here to visit my GitHub</a>
<br></br>
<p>Made my first library (pw-gen) for generating strong randomised passwords.</p>
</div>
</div>
</div>
<br></br>
<div id='section4' class='header-container'>
<div class="content">
<h2>Projects<i style='margin-left:20px;color:#AEC6CF;cursor:default;' class="fas fa-code-branch"></i></h2>
<p>All of my projects are up on my GitHub profile so be sure to check them out</p>
</div>
</div>
<div id='section5' class='header-container'>
<div class="content">
<h2>Useful Links<i style='margin-left:20px;color:#AEC6CF;cursor:default;' class="fas fa-link"></i></h2>
<p>Links to websites and resources that I find helpful whilst I am programming</p>
</div>
</div>
<div id='section6' class='header-container'>
<div class="content">
<h2>Contact<i style='margin-left:20px;color:#AEC6CF;cursor:default;' class="fas fa-pen"></i></h2>
<p>Contact me here for information or collaboration requests</p>
</div>
</div>
<div class='footer'>
<i class="fab fa-github" style='font-size:30px;margin-right:20px;'></i>
<i class="fab fa-stack-overflow" style='font-size:30px'></i>
<br></br>
<p>Copyright © 2021 lunAr-creator - Website Design by me (who else? :D)</p>
</div>
</div>
</body>
</html>
I am doing a popup image with close button and dimmed background. When the popup is displayed and users click outside of it, it supposes to close the popup. It works fine on other browser, but not safari. I found on Z-index problems on ipad that I need to put -webkit-transform: translate3d(0,0,0) to the same DOM level but I am not really sure about the concept. Can someone help me, please?
Here is my code:
/**********************HTMl*********************/
<body id="price">
<div class="site-wrapper">
<div class="site-wrapper-inner">
<div class="cover-container">
<?php include('header.php')?>
<div id="content-border" >
<div id="content">
<h1><strong>Packages</strong></h1>
<P id="package-p"></P>
<div>
<div id="price-col">
<button class="img-circle" id="price-circle" id="myBtn1" onClick="openPopup(1)">
<div>
<h4></h4>
<span id="currency">$</span>
<span id="price-large"></span>
<p id="price-small"></p>
<p></p>
</div>
</button>
</div>
<div id="myModal1" class="popup">
<div class="popup-content">
<img src="images/The-Apprentice_low.jpg" id="popup-content1"><span class="closeBtn" onClick="closePopup()">×</span>
</div>
</div>
<div id="price-col">
<button class="img-circle" id="price-circle" id="myBtn2" onClick="openPopup(2)">
<div>
<h4></h4>
<span id="currency">$</span>
<span id="price-large"></span>
<p id="price-small"></p>
<p></p>
</div>
</button>
</div>
<div id="myModal2" class="popup">
<div class="popup-content">
<img src="images/The-Celebrity-Chef_low.jpg" id="popup-content2"><span class="closeBtn" onClick="closePopup()">×</span>
</div>
</div>
</div>
</div>
</div>
<?php include('footer.php')?>
</div>
</div>
</div>
<?php include('html-body-end.php')?>
</body>
/*************************CSS***********************/
#package-p{
background-color: #fff;
color: #000;
padding: 10 20;
text-shadow: none;
}
#price-col{
margin:0 auto;
width:50%;
float: left;
text-align: center;
}
#price-circle{
margin: 30 auto;
background: #ffffff;
padding: 35px;
text-align: center;
height: 250px;
width: 250px;
display: table;
color: #222222;
box-shadow: 0px 0px 10px 5px rgba(206, 44, 44, 0.5);
border: 0;
transition: all 0.3s;
-moz-transition: all 0.3s; /* Firefox 4 */
-webkit-transition: all 0.3s; /* Safari and Chrome */
-o-transition: all 0.3s; /* Opera */
}
#price-circle > div{
display: table-cell;
vertical-align: middle;
}
#currency{
font-size: 30px;
}
#price-circle:hover{
box-shadow: 0px 0px 10px 5px rgba(255, 255, 255, 0.5);
background-color: #ce2c2c;
color: #fff;
}
/*Popup*/
.popup {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
/* padding-top: 300px; Location of the box */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
text-align: center;
}
.popup-content {
margin: auto;
color: #ffffff;
display: inline-block;
position: relative;
}
.popup::after, .popup::before{
display: block;
content: "";
height: 5%;
}
.popup-content img{
max-height: 90vh;
max-width: 90vw;
min-height: 170px;
min-width: 240px;
z-index: 10;
}
/* The Close Button */
.closeBtn{
color: rgba(255,255,255,5);
font-size: 36px;
font-weight: bold;
position: absolute;
margin-top: -2.1vh;
right: 0;
display: inline-block;
z-index: 10;
}
.closeBtn:hover, .closeBtn:focus{
color: #000;
cursor: pointer;
}
Thanks.
I created a footer and used fontawesome icons with border.
On the following code I display the items and intend to have them as the picture shows
I was nearly there until I found that when I resize the screen, the icons also shrink like the photo show
Here my styling:
$footer: #464646;
.footer-font-awesome{
font-family: 'FontAwesome';
display: inline-block;
width: 40px;
height: 40px;
border: 1px solid white;
border-radius: 50%;
line-height: 40px;
text-align: center;
font-size: 18px;
text-indent: 0;
}
footer#colophon{
background-color: $footer;
color: white;
padding: 20px 40px;
ul,li,p{
margin: 0;
}
.site-info{
.textwidget {
display: flex;
justify-content: center;
div.box{
display: flex;
width: 100%;
max-width: 25%;
align-items: center;
p{
padding-left:8px;
}
}
.email,
.phone,
.address{
padding-right: 40px;
}
.email{
&:before{
#extend .footer-font-awesome;
content: '\f003';
}
}
.phone{
&:before{
#extend .footer-font-awesome;
content: '\f095';
}
}
.back-top{
justify-content: center;
}
.address{
&:before{
#extend .footer-font-awesome;
content: '\f041';
}
}
}
}
}
Here my html structure:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
<footer id="colophon" class="site-footer" role="contentinfo">
<div class="site-info">
<section id="black-studio-tinymce-33" class="widget widget_black_studio_tinymce">
<div class="textwidget">
<div class="box email">
<p>Email<br> <span class="unbold"><a>info#web2web.co.za</a></span></p>
</div>
<div class="box phone">
<p>Phone<br> <span class="unbold">021 823 8384</span></p>
</div>
<div class="box address">
<p>Address<br> <span class="unbold">Century City, Cape Town</span></p>
</div>
<div class="box back-top">
<p><span class="unbold"><a class="back-top">To the top</a></span></p>
</div>
</div>
</section>
</div><!-- .site-info -->
</footer>
How can I style my icons as the first pictures shows with no problem even when I resize?
Hope you can edit from my snippet
I would just set min-width on .footer-font-awesome
.footer-font-awesome{
font-family: 'FontAwesome';
display: inline-block;
width: 40px;
min-width: 40px; // This...
height: 40px;
border: 1px solid white;
border-radius: 50%;
line-height: 40px;
text-align: center;
font-size: 18px;
text-indent: 0;
}
I'm trying to have a remote control with some buttons, and a div with the now playing info between two of them.
but it doesn't work.
as you can see, on an actual ipad, it renders differently, and i don't know how to fix it.
html:
<div id="buttons">
<button id="prev" class="control" onmousedown="skip('prev')"></button>
<div id="info"> gfegrbhthehrerhg</div>
<button id="next" class="control" onmousedown="skip('next')"></button><br />
<button id="rwd" class="control" onmousedown="changeSpeed(-2)"></button>
<button id="stop" class="control" onmousedown="emitCommand('stop')"></button>
<button id="play" class="control" onmousedown="emitCommand('play: loop: true speed: 100')"></button>
<button id="ffwd" class="control" onmousedown="changeSpeed(2)"></button>
css:
button.control {
display: inline-block;
width:150px;
height:150px;
background-size: 150px 150px;
border:0;
margin: 0.5%;
}
div#info {
width:300px;
height: 150px;
margin: 0 1.1%;
position: relative;
top: -58px;
margin-bottom: -50px;
border:1px solid red;
display: inline-block;
}
button#prev {
margin-left: 160px;
}
button#rwd {
margin-left: 160px;
}
#buttons {
margin: 0 auto;
border: 1px solid lightgray;
}
what am I doing wrong? what is the correct way to accomplish this?
Thanks
Add
vertical-align: top; to div#info
And remove the top: -58px; from div#info too
Here's a link to a working example: EXAMPLE LINK
Use a simple 4x2 grid system:
#buttonsWrapper {
margin: 0 auto;
border: 1px solid #BC5555;
height: 300px;
width: 600px;
}
.col4{width: 100%; float: left;}
.col3{width: 75%; float: left;}
.col2{width: 50%; float: left;}
.col1{width: 25%; float: left;}
.col1-height{height: 0; padding-bottom: 25%;} /* make 25% width squared */
.row{
clear: both;
}
#prev, #next, #rwd, #stop, #play, #ffwd{
-webkit-border-radius: 15px;
border-radius: 15px;
background-color: #888;
-webkit-transform: scale(0.95,0.95); /* Safari */ /* scale down to 95% */
transform: scale(0.95,0.95); /* scale down to 95% */
}
#info{
background-color: #ddd;
}
<div id="buttonsWrapper">
<div class="row">
<div id="prev" class="col1 col1-height"></div>
<div id="info" class="col2 col1-height"></div>
<div id="next" class="col1 col1-height"></div>
</div>
<div class="row">
<div id="rwd" class="col1 col1-height"></div>
<div id="stop" class="col1 col1-height"></div>
<div id="play" class="col1 col1-height"></div>
<div id="ffwd" class="col1 col1-height"></div>
</div>
</div>
I am creating following wizard.
I have tried following; but its not working as it should be. Its layout disturbs while resizing window. It should be responsive. What can be best way to implement it so that it should remain Responsive despite whatever resolution is.
Fiddle with issue
HTML:
<div class="col-md-10">
<div class="wizard-wrapper">
<div class="node-wrapper text-center wactive">
<div class="node"><span>1</span>
</div>
<label class="lbl-wizard">Singn Up</label>
</div>
<div class="node-wrapper text-center">
<div class="node"><span>2</span>
</div>
<label class="lbl-wizard">Order Info</label>
</div>
<div class="node-wrapper text-center">
<div class="node"><span>3</span>
</div>
<label class="lbl-wizard">Preview Info</label>
</div>
<div class="node-wrapper text-center">
<div class="node"><span>4</span>
</div>
<label class="lbl-wizard">Payment Method</label>
</div>
<div class="node-wrapper text-center">
<div class="node"><span>5</span>
</div>
<label class="lbl-wizard">Complete Order Info</label>
</div>
<div class="connection"></div>
</div>
</div>
CSS
/* wizard */
.wizard h2 {
margin-top: 5px;
}
.node {
background: #2d2f32;
border-radius: 30px;
color: #fff;
display: inline-block;
height: 37px;
text-align: center;
width: 37px;
border: 4px solid #C2C6C9;
}
.wactive .node {
background: #AA0405;
}
.node > span {
display: inline-block;
font-size: 14px;
padding-top: 4px;
font-family: open_sansbold;
}
.lbl-wizard {
display: block;
font-family: open_sansregular;
font-size: 14px;
color: #2d2f32;
padding-top: 5px;
}
.node-wrapper.text-center {
float: left;
padding: 0 5%;
position: relative;
z-index: 1;
}
.connection {
background: #c2c6c9;
display: inline-block;
height: 5px;
margin-top: -113px;
padding-top: 7px;
position: relative;
vertical-align: middle;
width: 100%;
z-index: 0;
}
FYI: I am using bootstrap.
You can set the width of a node.wrapper element to one fifth of the resolution width.
width: calc(100% / 5);
Also, you should change .connection so it stays at one position:
.connection {
background: #c2c6c9;
display: block; (new)
height: 5px;
margin-top: 38px; (new)
padding-top: 7px;
position: absolute; (new)
vertical-align: middle;
width: 100%;
z-index: 0;
}
Fiddle