How to create a breadcrumb navigation with CSS?

Following is the code to create breadcrumb navigation using CSS −


 Live Demo

<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
body {
   margin: 0px;
   margin-top: 10px;
   padding: 0px;
.breadcrumb {
   background-color: rgb(39, 39, 39);
   overflow: auto;
   height: auto;
li {
   display: inline-block;
   text-align: center;
   padding: 10px;
   font-size: 17px;
.links {
   text-decoration: none;
   color: rgb(178, 137, 253);
.links:hover {
   text-decoration: underline;
.breadcrumb ul li:before {
   padding: 8px;
   color: white;
   content: "/\00a0";
   text-decoration: none;
ul:last-child {
   color: white;
   font-weight: bolder;
   font-family: monospace;
<h1>Breadcrumb Navigation Example</h1>
<div class="breadcrumb">
<li><a class="links" href="#">Root</a></li>
<li><a class="links" href="#">Home</a></li>
<li><a class="links" href="#">User</a></li>
<li><a class="links" href="#">Desktop</a></li>
<h2>Hover over the links to see effect</h2>


The above code will produce the following output −