FREE Web Template Download
HTML CSS JAVASCRIPT SQL PHP BOOTSTRAP JQUERY ANGULARJS TUTORIALS REFERENCES EXAMPLES Blog
 

TheBestTutorials.css Navigation


TheBestTutorials.css provide all kinds for navigation bars:


Basic Navigation

The TheBestTutorials-navbar class creates a horizontal navigation bar:

Example

<ul class="subhodaya-navbar subhodaya-black">
  <li><a href="#">Home</a></li>
  <li><a href="#">Link 1</a></li>
  <li><a href="#">Link 2</a></li>
  <li><a href="#">Link 3</a></li>
</ul>
Try It Yourself »

Colored Navigation Bars



Example

<ul class="subhodaya-navbar subhodaya-light-grey">
<ul class="subhodaya-navbar subhodaya-green">
<ul class="subhodaya-navbar subhodaya-blue">
Try It Yourself »

Bordered Navigation Bars



Example

<ul class="subhodaya-navbar subhodaya-border subhodaya-light-grey">
<ul class="subhodaya-navbar subhodaya-border subhodaya-round subhodaya-light-grey">
<ul class="subhodaya-navbar subhodaya-card-8 subhodaya-light-grey">
Try It Yourself »

Active/Current Link


Example

<ul class="subhodaya-navbar subhodaya-border subhodaya-light-grey">
  <li><a class="subhodaya-green" href="#">Home</a></li>
  <li><a href="#">Link 1</a></li>
  <li><a href="#">Link 2</a></li>
  <li><a href="#">Link 3</a></li>
</ul>
Try It Yourself »

Hoverable Links

When you mouse over the links inside the navigation bar, the background color will change to grey.

If you want a different background color on hover, use any of the subhodaya-hover-color classes, and if you want a different text color on hover, use any of the subhodaya-hover-text-color classes:


Example

<ul class="subhodaya-navbar subhodaya-border subhodaya-light-grey">
  <li><a class="subhodaya-hover-red" href="#">Home</a></li>
  <li><a class="subhodaya-hover-blue" href="#">Link 1</a></li>
  <li><a class="subhodaya-hover-green" href="#">Link 2</a></li>
  <li><a class="subhodaya-hover-teal" href="#">Link 3</a></li>
</ul>
Try It Yourself »

Right-Aligned Links

Example

<ul class="subhodaya-navbar subhodaya-light-grey subhodaya-border">
  <li><a href="#">Home</a></li>
  <li><a href="#">Link 1</a></li>
  <li><a href="#">Link 2</a></li>
  <li class="subhodaya-right"><a class="subhodaya-green" href="#">Link 3</a></li>
</ul>
Try It Yourself »

Navigation Bar Size

Change the font size:


Example

<ul class="subhodaya-navbar subhodaya-green subhodaya-large">
<ul class="subhodaya-navbar subhodaya-green subhodaya-xlarge">
Try It Yourself »

Change the padding:


Example

<ul class="subhodaya-navbar subhodaya-green">
  <li><a class="subhodaya-padding-16" href="#">Home</a></li>
  <li><a class="subhodaya-padding-16" href="#">Link 1</a></li>
  <li><a class="subhodaya-padding-16" href="#">Link 2</a></li>
  <li><a class="subhodaya-padding-16" href="#">Link 3</a></li>
</ul>
Try It Yourself »

Customize the width of the list items with the CSS width property (Note: on smaller screens, they will transform to 100%):

Example

<ul class="subhodaya-navbar subhodaya-dark-grey subhodaya-center">
  <li style="width:50%"><a class="subhodaya-padding subhodaya-green" href="#">Home</a></li>
  <li style="width:50%"><a class="subhodaya-padding" href="#">Link 1</a></li>
</ul>
Try It Yourself »

Navigation Bar with Icons

Example

<ul class="subhodaya-navbar subhodaya-light-grey subhodaya-border subhodaya-large">
  <li><a class="subhodaya-green" href="#"><i class="fa fa-home subhodaya-large"></i></a></li>
  <li><a href="#"><i class="fa fa-search subhodaya-large"></i></a></li>
  <li><a href="#"><i class="fa fa-envelope subhodaya-large"></i></a></li>
  <li><a href="#"><i class="fa fa-globe subhodaya-large"></i></a></li>
  <li><a href="#"><i class="fa fa-sign-in subhodaya-large"></i></a></li>
</ul>
Try It Yourself »

The "fa fa" classes in the example above display "Font Awesome" icons.

Learn more about how to display icons in the chapter TheBestTutorials.css Icons.


Navigation Bar with Dropdown

Move the mouse over the "Dropdown" link:

Example

<ul class="subhodaya-navbar subhodaya-card-2 subhodaya-light-grey">
  <li><a href="#">Home</a></li>
  <li><a href="#">Link 1</a></li>
  <li class="subhodaya-dropdown-hover">
    <a href="#">Dropdown</a>
    <div class="subhodaya-dropdown-content subhodaya-white subhodaya-card-4">
      <a href="#">Link 1</a>
      <a href="#">Link 2</a>
      <a href="#">Link 3</a>
    </div>
  </li>
</ul>
Try It Yourself »

Note: When the dropdown menu is "open", the dropdown link gets a grey background color to indicate that it is active. To override this, add a subhodaya-hover-color class to both the "dropdown" <li> and <a>:

Tip: If you want a dropdown symbol next to the dropdown text, add a suitable icon (like ):

Example

<li class="subhodaya-dropdown-hover subhodaya-hover-orange">
  <a class="subhodaya-hover-orange" href="#">Dropdown <i class="fa fa-caret-down"></i></a>
  <div class="subhodaya-dropdown-content subhodaya-white subhodaya-card-4">
    <a href="#">Link 1</a>
    <a href="#">Link 2</a>
    <a href="#">Link 3</a>
  </div>
</li>
Try It Yourself »

Clickable Dropdown

Use TheBestTutorials-dropdown-click if you prefer to click on the dropdown link instead of hover:

Example

<li class="subhodaya-dropdown-click">
  <a onclick="myFunction()" href="javascript:void(0)">Dropdown <i class="fa fa-caret-down"></i></a>
  <div id="demo" class="subhodaya-dropdown-content subhodaya-white subhodaya-card-4">
    <a href="#">Link 1</a>
    <a href="#">Link 2</a>
    <a href="#">Link 3</a>
  </div>
</li>
Try It Yourself »

Dropnav

The TheBestTutorials-dropnav class creates a full-width dropdown menu:


Toggleable Dropnav

The example above use the "Dropnav" link to open the menu, and the "x" icon to close it. This example shows how to toggle the dropnav menu each time you click on the "Dropnav" button:


Fixed Navigation Bar

To force the navigation bar to stay at the top or at the bottom of the page, even when the user scrolls the page, wrap a <div> element around the <ul> and add the TheBestTutorials-top or TheBestTutorials-bottom class:

Fixed Top

<div class="subhodaya-top">
  <ul class="subhodaya-navbar">
    ...
  </ul>
</div>
Try it Yourself »

Fixed Bottom

<div class="subhodaya-bottom">
  <ul class="subhodaya-navbar">
    ...
  </ul>
</div>
Try it Yourself »

Collapsing the Navigation Bar

When the navigation bar takes up too much space on a small screen, and you do not want to display it vertically by default, you could use utility classes to hide and show specific links in the navigation bar.

In the example below, the navigation bar is replaced with a button (☰) in the top right corner when shown on tablets and mobile devices. When the button is clicked, the navigation bar will be displayed stacked:


Topnav

Another example of a navigation bar, is the subhodaya-topnav class. It is similar to TheBestTutorials-navbar, except that it will add an underline when you hover over the links, instead of a background color:

Example

<nav class="subhodaya-topnav subhodaya-green">
  <a href="#">Home</a>
  <a href="#">Link 1</a>
  <a href="#">Link 2</a>
  <a href="#">Link 3</a>
  <a href="#">Link 4</a>
</nav>
Try It Yourself »

Example with Font Awesome Icons

<nav class="subhodaya-topnav subhodaya-green">
  <a href="#"><i class="fa fa-home"></i></a>
  <a href="#">Link 1</a>
  <a href="#">Link 2</a>
  <a href="#">Link 3</a>
  <a href="#">Link 4</a>
</nav>
Try It Yourself »

Side Navigation

The TheBestTutorials-sidenav class creates a vertical navigation bar:

Go to the next chapter to learn more about the side navigation.