What is breadcrumbs in html

HTML | Breadcrumbs

While using a website, we often need to use the navigation bar, which consists of navigation tabs. These navigation tabs help the user to reach several sections of the website by just clicking them. However, it does not show the whole path of the section where the user at. For this purpose, the “breadcrumbs” are utilized in websites as they not only help the users but also display the structure of the website by showing the whole path of the section where they are at.

This article will demonstrate how to create breadcrumbs in HTML.

What is the Difference Between Navigation Bar and Breadcrumbs in HTML?

The navigation bar is mostly presented at the very top of the website. For instance, a navigation bar looks like this:

Whereas the breadcrumb is utilized to provide aid to the navigation bar, so it is placed above the content of the website like this:

You have realized the difference between the navigation bar and breadcrumbs. Now, the next section will demonstrate an example of creating breadcrumbs in HTML.

How to Create Breadcrumbs in HTML?

    tag which includes several
    tags contents as shown below in the code block:

By providing the above code, the output will look like this:

As you can see, the structure of the breadcrumbs has been successfully created. Now, apply styling properties to the HTML elements.

Style all Elements

* {
margin : 0 ;
padding : 0 ;
font-family : ‘Trebuchet MS’ , ‘Lucida Sans Unicode’ , ‘Lucida Grande’ , ‘Lucida Sans’ , Arial , sans-serif ;
}

The properties applied to all the elements “*” of HTML are explained below:

  • margin” property is given value “0”; it will not give space outside the element.
  • padding” property is given value “0”; it will not produce space around the content of the div element.
  • font-family” is utilized to select any font style.

Style main-content div

The div with the name “main-content” is applied with properties that are described below:

  • max-width” property specifies the width of the div main-content must not exceed “800px”.
  • margin” property with the value set as “0 auto” represents 0px space on top and bottom and equal space on the left and right of the div element.
  • padding” property is utilized to generate “20px” space around the content of the div element.

Style breadcrumbs ul Element

.breadcrumbs ul {
margin : 10px ;
padding : 20px ;
display : inline-flex ;
list-style : none ;
background-color : rgb ( 204 , 204 , 138 ) ;
}

    element of the div breadcrumbs. The explanation of these properties is mentioned below:

Оцените статью