How we can create a flat breadcrumb using pure HTML and CSS? Solution: See this CSS Flat Breadcrumb With Icons, Flat Breadcrumb Navigation UI Design.
Previously I have shared a stylish breadcrumb design which items expand on hover, but it has a flat design. Basically, A breadcrumb is a graphical control element which frequently used as a navigational aid in user interfaces and on web pages. It is used to show the current location of the webpage. In other words, it shows the page is under which category and sub-category. The breadcrumb is one of the major factors in the google search result, google give priority to this.
Today you will learn to create a Flat Breadcrumb Navigation UI Design. Basically, there is an arrow type breadcrumb with 6 items. The first item of any breadcrumb always will home, then it shows the categories. There are 6 items, the first item which is for home contains only a home icon, and left other contains icons with text. The design is a complete arrow type and flat interface. Also, there is a hover effect when you will hover on any item the background color will change.
So, Today I am sharing CSS Flat Breadcrumb With Icons. There I have used HTML to create the layout and CSS for styling. This is a pure CSS program, because there is no JS or any JS library. But there is a third-party library to place the icons. There are dummy text and icons in the breadcrumbs, but using the CSS codes you can do exactly the same on your website.
If you are thinking now how this flat breadcrumbs actually is, then see the preview given below.
Preview Of Breadcrumb Navigation UI
See this video preview to getting an idea of how this breadcrumb navigation looks like.
Now you can see this program visually, also you can see it live by pressing the button given above. If you like this program then get the source code of its.
You May Also Like:
CSS Flat Breadcrumb Source Code
Before sharing source code, let’s talk about it. First I have placed a heading text then a list using HTML <ul> & <li> commands. Inside every list item, I have placed a hyperlink <a> for links, but there is no link because it is only a sample. span tag for placing the icons, and texts. There I have used the font-awesome library to place the icons, inside the span tag I have only put the class names according to the library’s guidance.
Now using CSS I have placed all the items in the right place, as you can see in the preview. First with CSS I gave all basic values like size, position, margin, padding, etc to the list and list items. There I have used :before & :after commands and used content:'' and margin combination to create the arrow type design. Also there is a background color change hover effect, which is created using CSS :hover command.
Left all other things you will understand after getting the codes, I can’t explain all in writing. For creating this program you have to create only 2 files. First file for HTML and second file for CSS. Follow the steps to creating this program without any error.
index.html
Create an HTML file named ‘index.html‘ and put these codes given below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
<!DOCTYPE html> <!-- Code By Webdevtrick ( https://webdevtrick.com ) --> <html lang="en" > <head> <meta charset="UTF-8"> <title>Flat CSS Breadcrumb | Webdevtrick.com</title> <link href="https://netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet"> <link rel="stylesheet" href="style.css"> </head> <body> <h1>Flat CSS3 Breadcrumb</h1> <ul id="breadcrumb"> <li><a href="#"><span class="fa fa-home"> </span></a></li> <li><a href="#"><span class=" fa fa-info-circle"> </span> Web Kit</a></li> <li><a href="#"><span class="fa fa-snowflake-o"></span> UI Design</a></li> <li><a href="#"><span class="fa fa-desktop"> </span> Web Design</a></li> <li><a href="#"><span class="fa fa-paint-brush"> </span> Style</a></li> <li><a href="#"><span class="fa fa-css3"> </span> CSS3</a></li> </ul> </body> </html> |
style.css
Now create a CSS file named ‘style.css‘ and put these codes given below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
/* Code By Webdevtrick ( https://webdevtrick.com ) */ * { margin: 0; padding: 0; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 12px; } body { text-align: center; background-color: #f3f3f3; } h1 { font-weight: 100; font-size: 32px; padding: 40px; color: #212121; } #breadcrumb { list-style: none; display: inline-block; } #breadcrumb .fa { font-size: 14px; } #breadcrumb li { float: left; } #breadcrumb li a { color: #FFF; display: block; background: #3498db; text-decoration: none; position: relative; height: 40px; line-height: 40px; padding: 0 10px 0 5px; text-align: center; margin-right: 23px; margin-top: 10px } #breadcrumb li:nth-child(even) a { background-color: #2980b9; } #breadcrumb li:nth-child(even) a:before { border-color: #2980b9; border-left-color: transparent; } #breadcrumb li:nth-child(even) a:after { border-left-color: #2980b9; } #breadcrumb li:first-child a { padding-left: 15px; -moz-border-radius: 4px 0 0 4px; -webkit-border-radius: 4px; border-radius: 4px 0 0 4px; } #breadcrumb li:first-child a:before { border: none; } #breadcrumb li:last-child a { padding-right: 15px; -moz-border-radius: 0 4px 4px 0; -webkit-border-radius: 0; border-radius: 0 4px 4px 0; } #breadcrumb li:last-child a:after { border: none; } #breadcrumb li a:before, #breadcrumb li a:after { content: ""; position: absolute; top: 0; border: 0 solid #3498db; border-width: 20px 10px; width: 0; height: 0; } #breadcrumb li a:before { left: -20px; border-left-color: transparent; } #breadcrumb li a:after { left: 100%; border-color: transparent; border-left-color: #3498db; } #breadcrumb li a:hover { background-color: #fc1052; } #breadcrumb li a:hover:before { border-color: #fc1052; border-left-color: transparent; } #breadcrumb li a:hover:after { border-left-color: #fc1052; } #breadcrumb li a:active { background-color: #fc1052; } #breadcrumb li a:active:before { border-color: #fc1052; border-left-color: transparent; } #breadcrumb li a:active:after { border-left-color: #fc1052; } |
That’s It. Now you have successfully created CSS Flat Breadcrumb With Icons, Flat Breadcrumb Navigation UI Design. If you have any doubt or question comment down below.
Thanks For Visiting, Keep Visiting.