How to display bullet points under ~responsive~ horizontal timeline? - html

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>

Related

How to put bullets under breadcrumb timeline?

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

Equal horizontal space between links in responsive navigation?

I am trying to make horizontal menu navigation. I have several links in navigation, and I would like to have equal horizontal space between them.
How to make links in horizontal menu with equal space between them?
HTML:
<div id="header">
<div class="secondary-navigation">
<div itemscope itemtype="http://schema.org/SiteNavigationElement">
<nav id="navigation">
<ul id="menu-main" class="menu">
<li class="menu-item">Link</li>
<li class="menu-item">Link</li>
<li class="menu-item">Link</li>
<li class="menu-item">Link</li>
<li class="menu-item">Link</li>
<li class="menu-item">Link</li>
<li class="menu-item">Link</li>
<li class="menu-item">Link</li>
</ul>
Menu
</nav>
</div>
</div>
</div>
CSS:
#header {
position: relative;
float: left;
padding: 0 0 0 0;
clear: both;
}
/*-----------------------------------------------
/* Header navigation
/*---------------------------------------------*/
.secondary-navigation {
display: block;
width: 100%;
float: left;
}
.secondary-navigation a {
vertical-align: top;
color: #F1F1F1;
font-weight: bold;
margin-top: 8px;
margin-bottom: 4px;
line-height:18px;
font-size: 15px;
border-bottom: 2px solid #333888;
}
.secondary-navigation a:hover, .secondary-navigation .sfHover {
color: #F1F1F1;
border-bottom: 2px solid #F1F1F1;
}
.secondary-navigation li li a { line-height: 1 }
.secondary-navigation a .sub {
font-size: 12px;
font-weight: normal;
color: #CFCFCF;
text-transform: none;
}
.menu-item-has-children > a:after {
content: "▼";
font-size: 10px;
color: #F1F1F1;
position: absolute;
right: 12px;
top: 22px;
}
.footer-navigation .menu-item-has-children > a:after { display: none }
.sub-menu .menu-item-has-children>a:after {
right: 0;
top: 17px;
}
.menu .current-menu-item > a { background: #fff }
.menu .current-menu-item > a:after {
content: "";
position: absolute;
width: 100%;
height: 1px;
background: #fff;
bottom: 0px;
left: 0;
z-index: 1;
}
#navigation {
margin: 0 auto;
font-size: 13px;
width: 100%;
float: left;
}
#navigation ul {
margin: 0 auto;
list-style: none; /*Added*/}
#navigation .menu { float: left; }
#navigation ul li {
float: left;
position: relative;
margin-left: 0;
}
#navigation > ul li:first-child a { }
#navigation > ul li:last-child a { border-right: 0 }
#navigation ul .header-search { float: right }
#navigation > ul > li:last-child { border-right: none }
#navigation ul li a, #navigation ul li a:link, #navigation ul li a:visited { display: block }
#navigation > ul > .current a {
background: transparent;
color: #555 !important;
}
#navigation li:hover ul, #navigation li li:hover ul, #navigation li li li:hover ul, #navigation li li li li:hover ul {
opacity: 1;
left: -228px;
top: 0;
}
#navigation ul ul {
position: absolute;
width: 226px;
z-index: 400;
font-size: 12px;
color: #333888;
border: 1px solid #F1F1F1;
background: #FFFFFF;
padding: 0;
}
#navigation ul ul li {
margin-left: 0;
padding: 0 10%;
width: 80%;
color: #333;
}
#navigation ul ul li:hover { background: #F1F1F1 }
#navigation ul ul a, #navigation ul ul a:link, #navigation ul ul a:visited {
padding: 12px 0;
position: relative;
border-left: 0;
background: transparent;
border-right: 0;
text-transform: none;
line-height: 1.4;
margin-right: 0;
min-height: 100%;
}
#navigation ul ul li:last-child a { border-bottom: none }
#navigation ul ul {
opacity: 0;
left: -999em;
}
#navigation ul li:hover ul {
left: -1px;
opacity: 1;
top: 81px;
}
#navigation ul ul li:hover ul {
top: -1px;
left: -228px;
padding-top: 0;
}
#navigation ul ul ul:after { border-color: transparent }
I tried something like this, but it does not work for me.
You can use justify-content: space-between or justify-content: space-around flexbox property
ul {
display: flex;
justify-content: space-between;
border: 1px solid black;
list-style-type: none;
padding: 10px;
margin: 0;
}
<ul>
<li>Random Link</li>
<li>Random Link</li>
<li>Random Link</li>
<li>Random Link</li>
</ul>

link on li and align vertical: middle

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.

<li> member moves when mouse hovering on another <li> member

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 */
}

Single dropdown menu, drops to right

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