I'm trying to put some bullet points underneath a breadcrumb-style timeline, however I can't figure out how to do it. I have tried this:
<h1>Sign-Up Instructions</h1>
<div id="crumbs">
<ul>
<li><b>STEP 1:</b><br>Sign up and pay for<br>the options<br> you want</li>
<br>
<li> point here</li>
</ul>
</div>
<div id="crumbs">
<ul>
<li><b>STEP 2:</b><br>Sign up for<br>online sessions<br>(held most weeks)
<li><b>STEP 3:</b><br>Mock<br>OSCEs</li>
<li><b>STEP 4<br>(OPTIONAL):</b><br>Attend private<br>tutoring</li>
</ul>
</div>
But it separates one part of the timeline from the rest. I would like the timeline to be together.
Here is the HTML code of the working timeline, without bullet points:
<h1>Sign-Up Instructions</h1>
<div id="crumbs">
<ul class= "point">
<li><b>STEP 1:</b><br>Sign up and pay for<br>the options<br> you want</li>
<li><b>STEP 2:</b><br>Sign up for<br>online sessions<br>(held most weeks)</li>
<li><b>STEP 3:</b><br>Mock<br>OSCEs</li>
<li><b>STEP 4<br>(OPTIONAL):</b><br>Attend private<br>tutoring</li>
</ul>
</div>
Can someone let me know how I would do this? Thanks.
Here is the CSS:
h1 {
margin-bottom: 20px;
color: #4679bd;
font-weight: 400;
text-align: center;
font-family: Verdana, Geneva, sans-serif;
}
body {
margin: 0px;
font-family: Helvetica;
background: #f3f3f3;
line-height:25px;
}
#crumbs {
text-align: center;
margin-left: em;
margin-right: 1em;
}
#crumbs ul {
list-style: none;
display: inline-table;
position: relative;
}
#crumbs ul li {
display: inline;
}
#crumbs ul li a {
display: block;
float: left;
height: 130px;
background: #8bdbed;
text-align: center;
padding: 50px 0px 0 120px;
position: relative;
margin: 0 10px 0 0;
font-size: 20px;
text-decoration: none;
color: black;
line-height:25px;
}
#crumbs ul li a:after {
content: "";
border-top: 90px solid transparent;
border-bottom: 90px solid transparent;
border-left: 90px solid #8bdbed;
position: absolute;
right: -90px;
top: 0;
z-index: 1;
}
#crumbs ul li a:before {
content: "";
border-top: 90px solid transparent;
border-bottom: 90px solid transparent;
border-left: 90px solid #f3f3f3;
position: absolute;
left: 0;
top: 0;
}
#crumbs ul li:first-child a {
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
padding-left: 20px;
}
#crumbs ul li:first-child a:before {
display: none;
}
#crumbs ul li:last-child a {
padding-right: 30px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
#crumbs ul li:last-child a:after {
display: none;
}
/* Responsive */
#media (max-width: 1100px) {
#crumbs ul {
display: block;
margin-left: 20%;
margin-right: 20%;
}
#crumbs ul li {
display: block;
width: 100%;
}
#crumbs ul li a {
float: none;
padding: 20px 0 0 0;
margin: 0 0 5px 0;
}
#crumbs ul li a:before, #crumbs ul li a:after {
border-top: 0;
border-bottom: 0;
border-left: 0;
}
#crumbs ul li:first-child a {
border-radius: 0;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
#crumbs ul li:last-child a {
border-radius: 0;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
padding-right: 0;
}
/*Max width for smaller screen size*/
#media (max-width: 700px) {
#crumbs ul {
display: block;
margin-left: 5%;
margin-right: 10%;
}
#crumbs ul li {
display: block;
width: 100%;
}
#crumbs ul li a {
float: none;
padding: 10px 0 0 0;
margin: 0 0 5px 0;
}
#crumbs ul li a:before, #crumbs ul li a:after {
border-top: 0;
border-bottom: 0;
border-left: 0;
}
#crumbs ul li:first-child a {
border-radius: 0;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
#crumbs ul li:last-child a {
border-radius: 0;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
}
I think that put another unsorted list inside of the items, may be what you are looking for:
<h1>Sign-Up Instructions</h1>
<div id="crumbs">
<ul class="point">
<li>
<b>STEP 1:</b>
<ul>
<li>
Sign up and pay for<br>the options<br> you want
</li>
</ul>
</li>
<li>
<b>STEP 2:</b>
<ul>
<li>
Sign up for<br>online sessions<br>(held most weeks)
</li>
</ul>
</li>
...
</ul>
</div>
Add this ruleset to CSS:
.bullet {
font-size: 50px;
color: #000;
text-align: center;
margin: 20px auto;
}
and add this above and under each <li>:
<li class='bullet'>∗</li>
PLUNKER
SNIPPET
h1 {
margin-bottom: 20px;
color: #4679bd;
font-weight: 400;
text-align: center;
font-family: Verdana, Geneva, sans-serif;
}
body {
margin: 0px;
font-family: Helvetica;
background: #f3f3f3;
line-height: 25px;
}
#crumbs {
text-align: center;
margin-left: 1em;
margin-right: 1em;
}
#crumbs ul {
list-style: none;
display: inline-table;
position: relative;
}
#crumbs ul li {
display: inline;
}
#crumbs ul li a {
display: block;
float: left;
height: 130px;
background: #8bdbed;
text-align: center;
padding: 50px 0 0 120px;
position: relative;
margin: 0 10px 0 0;
font-size: 20px;
text-decoration: none;
color: black;
line-height: 25px;
}
#crumbs ul li a:after {
content: "";
border-top: 90px solid transparent;
border-bottom: 90px solid transparent;
border-left: 90px solid #8bdbed;
position: absolute;
right: -90px;
top: 0;
z-index: 1;
}
#crumbs ul li a:before {
content: "";
border-top: 90px solid transparent;
border-bottom: 90px solid transparent;
border-left: 90px solid #f3f3f3;
position: absolute;
left: 0;
top: 0;
}
#crumbs ul li:first-child a {
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
padding-left: 20px;
}
#crumbs ul li:first-child a:before {
display: none;
}
#crumbs ul li:last-child a {
padding-right: 30px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
#crumbs ul li:last-child a:after {
display: none;
}
.bullet {
font-size: 50px;
color: #000;
text-align: center;
margin: 20px auto;
}
/* Responsive */
#media (max-width: 1100px) {
#crumbs ul {
display: block;
margin-left: 20%;
margin-right: 20%;
}
#crumbs ul li {
display: block;
width: 100%;
}
#crumbs ul li a {
float: none;
padding: 20px 0 0 0;
margin: 0 0 5px 0;
}
#crumbs ul li a:before,
#crumbs ul li a:after {
border-top: 0;
border-bottom: 0;
border-left: 0;
}
#crumbs ul li:first-child a {
border-radius: 0;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
#crumbs ul li:last-child a {
border-radius: 0;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
padding-right: 0;
}
}
/*Max width for smaller screen size*/
#media(max-width: 700px) {
#crumbs ul {
display: block;
margin-left: 5%;
margin-right: 10%;
}
#crumbs ul li {
display: block;
width: 100%;
}
#crumbs ul li a {
float: none;
padding: 10px 0 0 0;
margin: 0 0 5px 0;
}
#crumbs ul li a:before,
#crumbs ul li a:after {
border-top: 0;
border-bottom: 0;
border-left: 0;
}
#crumbs ul li:first-child a {
border-radius: 0;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
#crumbs ul li:last-child a {
border-radius: 0;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
<h1>Sign-Up Instructions</h1>
<div id="crumbs">
<ul>
<li class='bullet'>∗</li>
<li><b>STEP 1:</b><br>Sign up and pay for<br>the options<br> you want
</li>
<li class='bullet'>∗</li>
<li><b>STEP 2:</b><br>Sign up for<br>online sessions<br>(held most weeks)
</li>
<li class='bullet'>∗</li>
<li><b>STEP 3:</b><br>Mock<br>OSCEs
</li>
<li class='bullet'>∗</li>
<li><b>STEP 4<br>(OPTIONAL):</b><br>Attend private<br>tutoring
</li>
<li class='bullet'>∗</li>
</ul>
</div>
</body>
</html>
May be below code will help! I have removed media queries form styles to avoid complexity.
There
I have added a nested ul within the main ul list items.
Added a CSS class named "test" to the nested ul. Use a proper name to the class accordingly.
Break the style inheritance from the parent ul by adding !important
Add the styles to make it as a usual unorderd list
h1 {
margin-bottom: 20px;
color: #4679bd;
font-weight: 400;
text-align: center;
font-family: Verdana, Geneva, sans-serif;
}
body {
margin: 0px;
font-family: Helvetica;
background: #f3f3f3;
line-height: 25px;
}
#crumbs {
text-align: center;
margin-left: 1em;
margin-right: 1em;
}
#crumbs ul {
display: inline-table;
position: relative;
}
#crumbs ul li {
display: inline;
}
ul.test {
float: left;
margin-top: 200px;
margin-left: -150px;
}
ul.test li {
list-style: square!important;
display: block!important;
display: list-item!important;
}
#crumbs ul li a {
display: block;
float: left;
height: 130px;
background: #8bdbed;
text-align: center;
padding: 50px 0px 0 120px;
position: relative;
margin: 0 10px 0 0;
font-size: 20px;
text-decoration: none;
color: black;
line-height: 25px;
}
#crumbs ul li a:after {
content: "";
border-top: 90px solid transparent;
border-bottom: 90px solid transparent;
border-left: 90px solid #8bdbed;
position: absolute;
right: -90px;
top: 0;
z-index: 1;
}
#crumbs ul li a:before {
content: "";
border-top: 90px solid transparent;
border-bottom: 90px solid transparent;
border-left: 90px solid #f3f3f3;
position: absolute;
left: 0;
top: 0;
}
#crumbs ul li:first-child a {
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
padding-left: 20px;
}
#crumbs ul li:first-child a:before {
display: none;
}
#crumbs ul li:last-child a {
padding-right: 30px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
#crumbs ul li:last-child a:after {
display: none;
}
<div id="crumbs">
<ul class="list-unstyled">
<li class="">
<b>STEP 1:</b><br>Sign up and pay for<br>the options<br> you want
<ul class="test">
<li>1st point here</li>
<li>2nd point here</li>
<li>3rd point here</li>
</ul>
</li>
<li></li>
<li class="">
<b>STEP 2:</b><br>Sign up for<br>online sessions<br>(held most weeks)
<ul class="test">
<li>1st point here</li>
<li>2nd point here</li>
<li>3rd point here</li>
</ul>
</li>
<li class=""><b>STEP 3:</b><br>Mock<br>OSCEs
</li>
<li class=""><b>STEP 4<br>(OPTIONAL):</b><br>Attend private<br>tutoring
</li>
</ul>
</div>
JSFiddle
Related
I'm trying to display some bullet points under each of the components of this breadcrumb-style timeline. I have gotten the answer to how to put bullets under the timeline while it's full screen but I don't know how to have the points display while the screen is squished or the screen size is smaller. How would I make the points display under each of the parts of the timeline, being responsive? If anyone can help, it would be greatly appreciated.
Here is my code snippet:
h1 {
margin-bottom: 20px;
color: #4679bd;
font-weight: 400;
text-align: center;
font-family: Verdana, Geneva, sans-serif;
}
body {
margin: 0px;
font-family: Helvetica;
background: #f3f3f3;
line-height: 25px;
}
#crumbs {
text-align: center;
margin-left: 1em;
margin-right: 1em;
}
#crumbs ul {
list-style: none;
display: inline-table;
position: relative;
}
#crumbs ul li {
display: inline;
}
/* bullet points under timeline */
ul.points {
float: left;
margin-top: 200px;
margin-left: -200px;
}
ul.points li {
list-style: square!important;
display: block!important;
display: list-item!important;
}
/*-----------------------*/
#crumbs ul li a {
display: block;
float: left;
height: 130px;
background: #8bdbed;
text-align: center;
padding: 50px 0 0 120px;
position: relative;
margin: 0 10px 0 0;
font-size: 20px;
text-decoration: none;
color: black;
line-height: 25px;
}
#crumbs ul li a:after {
content: "";
border-top: 90px solid transparent;
border-bottom: 90px solid transparent;
border-left: 90px solid #8bdbed;
position: absolute;
right: -90px;
top: 0;
z-index: 1;
}
#crumbs ul li a:before {
content: "";
border-top: 90px solid transparent;
border-bottom: 90px solid transparent;
border-left: 90px solid #f3f3f3;
position: absolute;
left: 0;
top: 0;
}
#crumbs ul li:first-child a {
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
padding-left: 20px;
}
#crumbs ul li:first-child a:before {
display: none;
}
#crumbs ul li:last-child a {
padding-right: 30px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
#crumbs ul li:last-child a:after {
display: none;
}
/* Responsive */
#media (max-width: 1100px) {
#crumbs ul {
display: block;
margin-left: 20%;
margin-right: 20%;
}
#crumbs ul li {
display: block;
width: 100%;
}
ul.points {
float: left;
margin-top: 200px;
margin-left: -200px;
}
ul.points li {
list-style: square!important;
display: block!important;
display: list-item!important;
}
#crumbs ul li a {
float: none;
padding: 20px 0 0 0;
margin: 0 0 5px 0;
}
#crumbs ul li a:before,
#crumbs ul li a:after {
border-top: 0;
border-bottom: 0;
border-left: 0;
}
#crumbs ul li:first-child a {
border-radius: 0;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
#crumbs ul li:last-child a {
border-radius: 0;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
padding-right: 0;
}
}
/*Max width for smaller screen size*/
#media(max-width: 700px) {
#crumbs ul {
display: block;
margin-left: 5%;
margin-right: 10%;
}
#crumbs ul li {
display: block;
width: 100%;
}
#crumbs ul li a {
float: none;
padding: 10px 0 0 0;
margin: 0 0 5px 0;
}
#crumbs ul li a:before,
#crumbs ul li a:after {
border-top: 0;
border-bottom: 0;
border-left: 0;
}
#crumbs ul li:first-child a {
border-radius: 0;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
#crumbs ul li:last-child a {
border-radius: 0;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
}
<div id="crumbs">
<ul class="list-unstyled">
<li class="">
<b>STEP 1:</b><br>Sign up and pay for<br>the options<br> you want
<ul class="points">
<li>1st point here</li>
<li>2nd point here</li>
<li>3rd point here</li>
</ul>
</li>
<li></li>
<li class="">
<b>STEP 2:</b><br>Sign up for<br>online sessions<br>(held most weeks)
<ul class="points">
<li>1st point here</li>
<li>2nd point here</li>
<li>3rd point here</li>
</ul>
</li>
<li class=""><b>STEP 3:</b><br>Mock<br>OSCEs
</li>
<li class=""><b>STEP 4<br>(OPTIONAL):</b><br>Attend private<br>tutoring
</li>
</ul>
</div>
Here are pictures of what I would like it to look like:
I tried it using col-xs-3. For larger screens you need to put some tries on it.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
h1 {
margin-bottom: 20px;
color: #4679bd;
font-weight: 400;
text-align: center;
font-family: Verdana, Geneva, sans-serif;
}
body {
margin: 0px;
font-family: Helvetica;
background: #f3f3f3;
line-height: 25px;
}
#crumbs {
text-align: center;
margin-left: 1em;
margin-right: 1em;
}
#crumbs ul {
list-style: none;
display: inline-table;
position: relative;
}
#crumbs ul li {
display: inline;
}
/* bullet points under timeline */
ul.points {
float: left;
margin-top: 200px;
margin-left: -200px;
}
ul.points li {
list-style: square!important;
display: block!important;
display: list-item!important;
}
/*-----------------------*/
#crumbs ul li a {
display: block;
float: left;
height: 130px;
background: #8bdbed;
text-align: center;
padding: 50px 0 0 120px;
position: relative;
margin: 0 10px 0 0;
font-size: 20px;
text-decoration: none;
color: black;
line-height: 25px;
}
#crumbs ul li a:after {
content: "";
border-top: 90px solid transparent;
border-bottom: 90px solid transparent;
border-left: 90px solid #8bdbed;
position: absolute;
right: -90px;
top: 0;
z-index: 1;
}
#crumbs ul li a:before {
content: "";
border-top: 90px solid transparent;
border-bottom: 90px solid transparent;
border-left: 90px solid #f3f3f3;
position: absolute;
left: 0;
top: 0;
}
#crumbs ul li:first-child a {
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
padding-left: 20px;
}
#crumbs ul li:first-child a:before {
display: none;
}
#crumbs ul li:last-child a {
padding-right: 30px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
#crumbs ul li:last-child a:after {
display: none;
}
/* Responsive */
#media (max-width: 1100px) {
#crumbs ul {
display: block;
margin-left: 20%;
margin-right: 20%;
}
#crumbs ul li {
display: block;
width: 100%;
}
ul.points {
float: left;
margin-top: 200px;
margin-left: -200px;
}
ul.points li {
list-style: square!important;
display: block!important;
display: list-item!important;
}
#crumbs ul li a {
float: none;
padding: 20px 0 0 0;
margin: 0 0 5px 0;
}
#crumbs ul li a:before,
#crumbs ul li a:after {
border-top: 0;
border-bottom: 0;
border-left: 0;
}
#crumbs ul li:first-child a {
border-radius: 0;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
#crumbs ul li:last-child a {
border-radius: 0;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
padding-right: 0;
}
}
/*Max width for smaller screen size*/
#media(max-width: 700px) {
#crumbs ul {
display: block;
margin-left: 5%;
margin-right: 10%;
}
#crumbs ul li {
display: block;
width: 100%;
}
#crumbs ul li a {
float: none;
padding: 10px 0 0 0;
margin: 0 0 5px 0;
}
#crumbs ul li a:before,
#crumbs ul li a:after {
border-top: 0;
border-bottom: 0;
border-left: 0;
}
#crumbs ul li:first-child a {
border-radius: 0;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
#crumbs ul li:last-child a {
border-radius: 0;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
}
</style>
<br>
<div id="crumbs">
<ul class="list-unstyled">
<li class="col-xs-3" style="padding:0px;margin:0;">
<b>STEP 1:</b><br>Sign up and pay for<br>the options<br> you want
<!-- <ul class="points">
<li>1st point here</li>
<li>2nd point here</li>
<li>3rd point here</li>
</ul> -->
</li>
<li></li>
<li class="col-xs-3" style="padding:0px;margin:0;">
<b>STEP 2:</b><br>Sign up for<br>online sessions<br>(held most weeks)
<!-- <ul class="points">
<li>1st point here</li>
<li>2nd point here</li>
<li>3rd point here</li>
</ul> -->
</li>
<li class="col-xs-3" style="padding:0px;margin:0;"><b>STEP 3:</b><br>Mock<br>OSCEs
</li>
<li class="col-xs-3" style="padding:0px;margin:0;"><b>STEP 4<br>(OPTIONAL):</b><br>Attend private<br>tutoring
</li>
</ul>
</div>
I am working on this step by step pattern and I am having some issues aligning the text to be in the middle as you can see here: https://jsfiddle.net/54vtc0n0/
I tried the align-vertical:middle but that did not work for me, maybe I did it wrong? Do any of you have any ideas on how to align this?
Also, I want to link the blue steps to a url so when you click on the validated step it takes you to a page. However it looks like I can't have an href on an li pointing to an outside page. I really need this to link to a url. Does anyone knows a work around.
Thanks in advance
HTML:
<!doctype html>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<div id="crumbs">
<ul>
<li class="blue">Start <i class="fa fa-check-circle-o fa-lg" style = "align: right" ></i></li>
<li >About you </li>
<li class= "grey">Plans</li>
<li class= "grey">Details</li>
<li class="grey">Enroll</li>
</ul>
</div>
</div>
CSS:
#crumbs ul {
list-style: none;
display: inline-table;
}
#crumbs ul li {
display: inline;
}
#crumbs ul li a {
display: block;
float: left;
background: #3498db;
text-align: rigth;
padding: 25px 15px 0 40px;
position: relative;
margin: 0 0px 5px 0;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
}
#crumbs ul li a:after {
content: "";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #009bda;
position: absolute; right: -25px; top: 0;
z-index: 1;
}
#crumbs ul li a:before {
content: "";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #fff;
position: absolute; left: 0; top: 0;
}
#crumbs ul li:first-child a {
border-top: 0px; border-bottom: 0px;
}
#crumbs ul li:first-child a:before {
display: none;
}
#crumbs ul li:last-child a {
padding-right: 8px;
padding-bottom: 5px;
border-top-right-radius: 0px; border-bottom: 0px;
}
#crumbs ul li:last-child a:after {
display: none;
}
#crumbs ul li a:hover {
background: #ed5338;
}
#crumbs ul li a:hover:after {
border-left-color: #ed5338;
}
<!-----------------------The non active state-------------------------->
#crumbs ul li.notactive {
display: inline;
}
#crumbs ul li.notactive a {
display: block;
float: left;
background: #d1d1ce;
text-align: rigth;
padding: 25px 15px 0 60px;
position: relative;
margin: 0 0px 5px 0;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
}
#crumbs ul li.notactive a:after {
content: "";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #d1d1ce;
position: absolute; right: -25px; top: 0;
z-index: 1;
}
#crumbs ul li.notactive a:before {
content: "";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid transparent;
position: absolute; left: 0; top: 0;
}
#crumbs ul li.notactive:first-child a {
border-top: 0px; border-bottom: 0px;
}
#crumbs ul li.notactive:first-child a:before {
display: none;
}
#crumbs ul li.notactive:last-child a {
padding-right: 10px;
padding-bottom: 5px;
border-top-right-radius: 0px; border-bottom: 0px;
}
#crumbs ul li.notactive:last-child a:after {
display: none;
}
#crumbs ul li a:hover {
background: #ed5338;
}
#crumbs ul li a:hover:after {
border-left-color: #ed5338;
}
<!-------------------Blue box------------------------->
#crumbs ul li.blue {
display: inline;
}
#crumbs ul li.blue a {
display: block;
float: left;
background: #009bda;
text-align: rigth;
padding: 25px 15px 0 60px;
position: relative;
margin: 0 0px 5px 0;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
}
<!-------------------Grey box------------------------->
#crumbs ul li.grey {
display: inline;
}
#crumbs ul li.grey a {
display: block;
float: left;
background: #d1d1ce;
text-align: rigth;
padding: 25px 15px 0 60px;
position: relative;
margin: 0 0px 5px 0;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
}
#crumbs ul li.grey a:after {
content: "";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #d1d1ce;
position: absolute; right: -25px; top: 0;
z-index: 1;
}
#crumbs ul li.grey a:before {
content: "";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid transparent;
position: absolute; left: 0; top: 0;
}
So using this simple tutorial which I googled:
https://css-tricks.com/triangle-breadcrumbs/
I was able to recreate your "breadcrumbs" by changing the colours..
https://jsfiddle.net/54vtc0n0/2/
(Credit goes to author of tutorial: Chris Coyier)
You can use java script to change the active link/tab colour by changing the css for that tab, for example:
HTML
<ul class="breadcrumb">
<li>Start</li>
<li>About you</li>
<li>Plans</li>
<li>Details</li>
<li>Enroll</li>
</ul>
CSS:
.breadcrumb {
list-style: none;
overflow: hidden;
font: 18px Helvetica, Arial, Sans-Serif;
}
.breadcrumb li {
float: left;
}
.breadcrumb li a {
color: white;
text-decoration: none;
padding: 10px 0 10px 65px;
background: #009BDA;
position: relative;
display: block;
float: left;
}
.breadcrumb li a:after {
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent; /* Go big on the size, and let overflow hide */
border-bottom: 50px solid transparent;
border-left: 30px solid #009BDA;
position: absolute;
top: 50%;
margin-top: -50px;
left: 100%;
z-index: 2;
}
.breadcrumb li a:before {
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent;
border-bottom: 50px solid transparent;
border-left: 30px solid white;
position: absolute;
top: 50%;
margin-top: -50px;
margin-left: 1px;
left: 100%;
z-index: 1;
}
.breadcrumb li:first-child a {
padding-left: 10px;
}
.breadcrumb li:nth-child(2) a { background: #D1D1CE; }
.breadcrumb li:nth-child(2) a:after { border-left-color: #D1D1CE; }
.breadcrumb li:nth-child(3) a { background: #D1D1CE; }
.breadcrumb li:nth-child(3) a:after { border-left-color: #D1D1CE; }
.breadcrumb li:nth-child(4) a { background: #D1D1CE; }
.breadcrumb li:nth-child(4) a:after { border-left-color: #D1D1CE; }
.breadcrumb li:nth-child(5) a { background: #D1D1CE; }
.breadcrumb li:nth-child(5) a:after { border-left-color: #D1D1CE; }
.breadcrumb li a:hover { background: #A5A5A5; }
.breadcrumb li a:hover:after { border-left-color: #A5A5A5 !important; }
Also a little advice when formatting your css, each css rule should not be tabbed in.. it is not HTML. Unless you're using something like media queries or SASS when its needed then go ahead.
Your padding is making the text does not centered vertically
So you can adjust it like this:
*{
box-sizing: border-box;
}
#crumbs ul {
display: inline-table;
}
#crumbs ul li {
display:table-cell;
vertical-align: middle;
}
#crumbs ul li a {
display:table-cell;
vertical-align: middle;
float: left;
background: #009bda;
text-align: rigth;
padding: 15px 5px 15px 60px; /*changed*/
position: relative;
/* margin: 0px 0px 5px 0; */
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
height: 50px; /*added*/
}
#crumbs ul li a:after {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #009bda;
position: absolute;
right: -25px;
top: 0;
z-index: 1;
}
#crumbs ul li a:before {
content:'';
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #fff;
position: absolute;
left: 0;
top: 0;
}
#crumbs ul li:first-child a {
border-top: 0px;
border-bottom: 0px;
}
#crumbs ul li:first-child a:before {
display: none;
}
#crumbs ul li:last-child a {
padding-right: 10px;
padding-bottom: 5px;
border-top-right-radius: 0px;
border-bottom: 0px;
}
#crumbs ul li:last-child a:after {
display: none;
}
#crumbs ul li a:hover {
background: #ed5338;
}
#crumbs ul li a:hover:after {
border-left-color: #ed5338;
}
<!-----------------------The non active state--------------------------> #crumbs ul li.notactive {
display: inline;
}
#crumbs ul li.notactive a {
display: block;
float: left;
background: #d1d1ce;
text-align: rigth;
padding: 25px 15px 0 60px;
position: relative;
margin: 0 0px 5px 0;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
}
#crumbs ul li.notactive a:after {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #d1d1ce;
position: absolute;
right: -25px;
top: 0;
z-index: 1;
}
#crumbs ul li.notactive a:before {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid transparent;
position: absolute;
left: 0;
top: 0;
}
#crumbs ul li.notactive:first-child a {
border-top: 0px;
border-bottom: 0px;
}
#crumbs ul li.notactive:first-child a:before {
display: none;
}
#crumbs ul li.notactive:last-child a {
padding-right: 10px;
padding-bottom: 5px;
border-top-right-radius: 0px;
border-bottom: 0px;
}
#crumbs ul li.notactive:last-child a:after {
display: none;
}
#crumbs ul li a:hover {
background: #ed5338;
}
#crumbs ul li a:hover:after {
border-left-color: #ed5338;
}
<!-------------------Blue box-------------------------> #crumbs ul li.blue {
display: inline;
}
#crumbs ul li.blue a {
display: block;
float: left;
background: #009bda;
text-align: rigth;
padding: 25px 15px 0 60px;
position: relative;
margin: 0 0px 5px 0;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
}
<!-------------------Grey box-------------------------> #crumbs ul li.grey {
display: inline;
}
#crumbs ul li.grey a {
display: block;
float: left;
background: #d1d1ce;
text-align: rigth;
padding: 15px 15px 15px 60px; /*changed*/
position: relative;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
height: 50px;
}
#crumbs ul li.grey a:after {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #d1d1ce;
position: absolute;
right: -25px;
top: 0;
z-index: 1;
}
#crumbs ul li.grey a:before {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid transparent;
position: absolute;
left: 0;
top: 0;
}
<div id="crumbs">
<ul>
<li>Start
</li>
<li class="grey">About you
</li>
<li class="grey">Plans
</li>
<li class="grey">Details
</li>
<li class="grey">Enroll
</li>
</ul>
</div>
Or you can use flexbox like this:
* {
box-sizing: border-box;
}
#crumbs ul {
display: inline-table;
}
#crumbs ul li {
display:table-cell;
vertical-align: middle;
}
#crumbs ul li a {
display: flex;
align-items: center;
float: left;
background: #009bda;
text-align: rigth;
padding-left: 60px; /*changed*/
position: relative;
/* margin: 0px 0px 5px 0; */
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
/* padding-bottom: 5px; */
height: 50px;
}
#crumbs ul li a:after {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #009bda;
position: absolute;
right: -25px;
top: 0;
z-index: 1;
}
#crumbs ul li a:before {
content:'';
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #fff;
position: absolute;
left: 0;
top: 0;
}
#crumbs ul li:first-child a {
border-top: 0px;
border-bottom: 0px;
}
#crumbs ul li:first-child a:before {
display: none;
}
#crumbs ul li:last-child a {
padding-right: 10px;
/*padding-bottom: 5px;*/
border-top-right-radius: 0px;
border-bottom: 0px;
}
#crumbs ul li:last-child a:after {
display: none;
}
#crumbs ul li a:hover {
background: #ed5338;
}
#crumbs ul li a:hover:after {
border-left-color: #ed5338;
}
<!-----------------------The non active state--------------------------> #crumbs ul li.notactive {
display: inline;
}
#crumbs ul li.notactive a {
display: block;
float: left;
background: #d1d1ce;
text-align: rigth;
padding: 25px 15px 0 60px;
position: relative;
margin: 0 0px 5px 0;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
}
#crumbs ul li.notactive a:after {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #d1d1ce;
position: absolute;
right: -25px;
top: 0;
z-index: 1;
}
#crumbs ul li.notactive a:before {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid transparent;
position: absolute;
left: 0;
top: 0;
}
#crumbs ul li.notactive:first-child a {
border-top: 0px;
border-bottom: 0px;
}
#crumbs ul li.notactive:first-child a:before {
display: none;
}
#crumbs ul li.notactive:last-child a {
padding-right: 10px;
padding-bottom: 5px;
border-top-right-radius: 0px;
border-bottom: 0px;
}
#crumbs ul li.notactive:last-child a:after {
display: none;
}
#crumbs ul li a:hover {
background: #ed5338;
}
#crumbs ul li a:hover:after {
border-left-color: #ed5338;
}
<!-------------------Blue box-------------------------> #crumbs ul li.blue {
display: inline;
}
#crumbs ul li.blue a {
display: block;
float: left;
background: #009bda;
text-align: rigth;
padding: 25px 15px 0 60px;
position: relative;
margin: 0 0px 5px 0;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
padding-bottom: 5px;
}
<!-------------------Grey box-------------------------> #crumbs ul li.grey {
display: inline;
}
#crumbs ul li.grey a {
/* display: block; */
float: left;
background: #d1d1ce;
text-align: rigth;
padding-left: 60px;
position: relative;
/* margin: 0 0px 5px 0; */
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #fff;
padding-right: 5px;
/* padding-bottom: 5px; */
}
#crumbs ul li.grey a:after {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid #d1d1ce;
position: absolute;
right: -25px;
top: 0;
z-index: 1;
}
#crumbs ul li.grey a:before {
content:"";
border-top: 25px solid transparent;
border-bottom: 25px solid transparent;
border-left: 25px solid transparent;
position: absolute;
left: 0;
top: 0;
}
<div id="crumbs">
<ul>
<li>Start
</li>
<li class="grey">About you
</li>
<li class="grey">Plans
</li>
<li class="grey">Details
</li>
<li class="grey">Enroll
</li>
</ul>
</div>
In both case I commented the changed code.
Why does my <li> element move when I hover over another <li> member? When I try to make it static by setting position to absolute, its still won't locate statically...
Here's the code :
/*Global Settings*/
a {
color: white;
}
body {
padding: 0px;
margin: 0px;
}
/********************/
/*Navigation Bar Setting*/
#navbar {
background: red;
height: 37px;
}
#navbar > ul {
padding: 0px;
margin: 0px;
list-style: none;
}
#navbar > ul > li {
/*display: inline;*/
float: left;
padding: 8px;
height: 16px;
padding-right: 10px;
text-align: center;
}
#navbar > ul > li:hover {
border-bottom: 5px solid rgb(0, 0, 0);
}
#firsttab:hover > ul {
margin: 0px;
height: 60px;
padding: 5px;
padding-left: 0px;
padding-right: 0px;
top: 37px;
left: 111px;
background: rgb(119, 14, 14);
position: absolute;
}
#secondtab:hover > ul {
margin: 0px;
height: 60px;
padding: 5px;
padding-left: 5px;
padding-right: 5px;
top: 37px;
left: 261px;
background: rgb(119, 14, 14);
position: absolute;
}
#firsttab:hover > ul > li {
display: block;
padding: 10px;
height: 8px;
padding-top: 5px;
padding-right: 10px;
padding-left: 10px;
padding-bottom: 15px;
}
#secondtab:hover > ul > li {
display: block;
padding-top: 5px;
padding-right: 10px;
padding-left: 10px;
padding-bottom: 15px;
height: 8px;
}
#secondtab:hover > ul > li:hover {
border-bottom: 5px solid black;
}
#firsttab:hover > ul > li:hover {
border-bottom: 5px solid black;
}
#home {
background: rgb(119, 14, 14);
height: 16px;
border-bottom: 5px solid rgb(119, 14, 14);
}
li > ul {
list-style: none;
}
li > ul > li {
display: none;
}
/********************/
#middle > ul {
list-style: none;
}
<div id="navbar">
<ul>
<li id="home">
<a>Home</a>
</li>
<li>
<a>News</a>
</li>
<li id="firsttab">
<a>Computer</a>
<ul>
<li>Software</li>
<li>Hardware</li>
</ul>
</li>
<li>
<a>Internet</a>
</li>
<li id="secondtab">
<a>HandPhone</a>
<ul>
<li>Software</li>
<li>Hardware</li>
</ul>
</li>
<li>
<a>Online Stream</a>
</li>
</ul>
</div>
<div id="middle">
<ul>
<li>tab</li>
<li>konten</li>
<li>tab</li>
</ul>
</div>
First screenshot
Second screenshot
Try to add border-bottom: 5px solid transparent; to your li like this:
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
/*Global Settings*/
a{
color: white;
}
body{
padding: 0px;
margin: 0px;
}
/********************/
/*Navigation Bar Setting*/
#navbar{
background: red;
height: 37px;
}
#navbar > ul{
padding: 0px;
margin: 0px;
list-style: none;
}
#navbar > ul > li{
/*display: inline;*/
float: left;
padding: 8px;
height: 16px;
padding-right: 10px;
text-align: center;
}
#navbar > ul > li:hover{
border-bottom: 5px solid rgb(0, 0, 0);
}
#firsttab:hover > ul{
margin: 0px;
height: 60px;
padding: 5px;
padding-left: 0px;
padding-right: 0px;
top: 37px;
left: 111px;
background: rgb(119, 14, 14);
position: absolute;
}
#secondtab:hover > ul{
margin: 0px;
height: 60px;
padding: 5px;
padding-left: 5px;
padding-right: 5px;
top: 37px;
left: 261px;
background: rgb(119, 14, 14);
position: absolute;
}
#firsttab:hover > ul > li{
display: block;
padding: 10px;
height: 8px;
padding-top: 5px;
padding-right: 10px;
padding-left: 10px;
padding-bottom: 15px;
border-bottom: 5px solid transparent;
}
#secondtab:hover > ul > li{
display: block;
padding-top: 5px;
padding-right: 10px;
padding-left: 10px;
padding-bottom: 15px;
height: 8px;
border-bottom: 5px solid transparent;
}
#secondtab:hover > ul > li:hover{
border-bottom: 5px solid black;
}
#firsttab:hover > ul > li:hover{
border-bottom: 5px solid black;
}
#home{
background: rgb(119, 14, 14);
height: 16px;
border-bottom: 5px solid rgb(119, 14, 14);
}
li > ul{
list-style: none;
}
li > ul > li{
display: none;
}
/********************/
#middle > ul{
list-style: none;
}
</style>
</head>
<body>
<div id="navbar">
<ul>
<li id="home"><a>Home</a></li>
<li><a>News</a></li>
<li id="firsttab"><a>Computer</a>
<ul>
<li>Software</li>
<li>Hardware</li>
</ul>
</li>
<li><a>Internet</a>
</li>
<li id="secondtab"><a>HandPhone</a>
<ul>
<li>Software</li>
<li>Hardware</li>
</ul>
</li>
<li><a>Online Stream</a></li>
</ul>
</div>
<div id="middle">
<ul>
<li>tab</li>
<li>konten</li>
<li>tab</li>
</ul>
</div>
</body>
</html>
Updated my answer:
CSS:
#firsttab:hover > ul > li{
display: block;
padding: 10px;
height: 8px;
padding-top: 5px;
padding-right: 10px;
padding-left: 10px;
padding-bottom: 15px;
border-bottom: 5px solid transparent; / *newly added */
}
#secondtab:hover > ul > li{
display: block;
padding-top: 5px;
padding-right: 10px;
padding-left: 10px;
padding-bottom: 15px;
height: 8px;
border-bottom: 5px solid transparent; / *newly added */
}
I want to make my navbar directly in the middle of the page. So as i scroll down the rest of my content appears from beneath. Could someone please help and also explain how to position my background image to fixed so as i scroll the background doesn't move and lose its quality in resolution.
.menu-wrap {
width: 750px;
margin: 0 auto;
list-style: none;
}
/* DROPDOWN */
.ulMenu {
padding: 0;
margin: 0;
}
.navMenu ul {
padding: 0;
margin: 0;
line-height: 30px;
}
navMenu {
padding: 0;
margin: 0;
}
.navMenu li {
list-style-type: none;
padding: 0;
margin: 0;
float: left;
position: relative;
}
.navMenu ul li a {
text-align: center;
padding: 10px;
width: 150px;
height: 30px;
display: block;
color: white;
background-color: rgba(233, 233, 233, 0.5);
text-decoration: none;
border-radius: 0px;
font-family: 'Raleway', sans-serif;
font-size: 20px;
}
.navMenu ul ul {
position: absolute;
visibility: hidden;
}
.navMenu ul li:hover ul {
visibility: visible;
}
.ulMenu .arrow {
font-size: 10px;
}
.navMenu ul li:hover ul li a:hover {
background-color: rgba(93, 93, 93, 0.5);
}
.navMenu li:hover {
background-color: none;
}
.navMenu a:hover {
color: blue;
}
.navMenu ul li ul li {
padding: 2px 0 0 0;
}
.navMenu ul li {
padding: 0 2px 0 0;
}
/* DROPDOWN ENDED */
html {
background-image: url("indexImg.jpg");
background-size: cover;
}
<div class="menu-wrap">
<nav class="navMenu">
<ul class="ulMenu">
<li>Home
</li>
<li>
Products<span class="arrow">▼</span>
<ul>
<li>#
</li>
<li>#
</li>
</ul>
</li>
<li>Contact Us
</li>
<li>About
</li>
</ul>
</nav>
</div>
.menu-wrap {
position: relative;
}
.navMenu {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
I hope this is what u need
Check if it could complete your code
HTML
<nav>
<ul class="nav">
<li>Home</li>
<li>Product
<ul>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
</li>
<li>Contact us
<li>About</li>
CSS
nav {
display: block;
text-align: center;
}
nav ul {
margin: 0;
padding:0;
list-style: none;
}
.nav a {
display:block;
background: #111;
color: #fff;
text-decoration: none;
padding: 0.8em 1.8em;
text-transform: uppercase;
font-size: 80%;
letter-spacing: 2px;
text-shadow: 0 -1px 0 #000;
position: relative;
}
.nav{
vertical-align: top;
display: inline-block;
box-shadow:
1px -1px -1px 1px #000,
-1px 1px -1px 1px #fff,
0 0 6px 3px #fff;
border-radius:6px;
}
.nav li {
position: relative;
}
.nav > li {
float: left;
border-bottom: 4px #aaa solid;
margin-right: 1px;
}
.nav > li > a {
margin-bottom: 1px;
box-shadow: inset 0 2em .33em -0.5em #555;
}
.nav > li:hover,
.nav > li:hover > a {
border-bottom-color: orange;
}
.nav li:hover > a {
color:orange;
}
.nav > li:first-child {
border-radius: 4px 0 0 4px;
}
.nav > li:first-child > a {
border-radius: 4px 0 0 0;
}
.nav > li:last-child {
border-radius: 0 0 4px 0;
margin-right: 0;
}
.nav > li:last-child > a {
border-radius: 0 4px 0 0;
}
.nav li li a {
margin-top: 1px;
}
.nav li a:first-child:nth-last-child(2):before {
content: "";
position: absolute;
height: 0;
width: 0;
border: 5px solid transparent;
top: 50% ;
right:5px;
}
.nav ul {
position: absolute;
white-space: nowrap;
border-bottom: 5px solid orange;
z-index: 1;
left: -99999em;
}
.nav > li:hover > ul {
left: auto;
margin-top: 5px;
min-width: 100%;
}
.nav > li li:hover > ul {
left: 100%;
margin-left: 1px;
top: -1px;
}
/* arrow hover styling */
.nav > li > a:first-child:nth-last-child(2):before {
border-top-color: #aaa;
}
.nav > li:hover > a:first-child:nth-last-child(2):before {
border: 5px solid transparent;
border-bottom-color: orange;
margin-top:-5px
}
.nav li li > a:first-child:nth-last-child(2):before {
border-left-color: #aaa;
margin-top: -5px
}
.nav li li:hover > a:first-child:nth-last-child(2):before {
border: 5px solid transparent;
border-right-color: orange;
right: 10px;
}
I have some problems with a dropdown. I want that it drops to the left side, but I don't know how to do that. I've tried some stuff with margin-right and padding, but I cant find a way to fix it. Code is here:
ul {
list-style: none;
padding: 0px;
margin: 0px;
}
ul li {
display: block;
position: relative;
float: right;
}
li ul {
display: none;
margin-top: -11px;
}
ul li a {
display: block;
padding: 5px 10px 5px 10px;
text-decoration: none;
color: #f00;
}
li:hover ul {
display: block;
position: absolute;
right: 0px;
}
li:hover li {
float: left;
margin-left: 10px;
}
li:hover a {
background: transparent;
margin-left: 10px;
}
li:hover li a:hover {
background: #000;
}
#drop-nav li ul li {
border-top: 0px;
margin-right: 40px;
background-color: #FFFFFF;
width: 260px;
}
img.menu {
height: 39px;
width: 34px;
margin-top: 41px;
}
<ul id="drop-nav">
<li><img src="https://cdn4.iconfinder.com/data/icons/wirecons-free-vector-icons/32/menu-alt-256.png" class="menu">
<ul>
<li>General Inquiries</li>
<li>Ask me a Question</li>
</ul>
</li>
</ul>
li:hover ul {
display: block;
position: absolute;
right:0px;
}