Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Building the Header Navigation | Creating a Portfolio Website with Bootstrap
Bootstrap: Building Stylish Websites

Building the Header NavigationBuilding the Header Navigation

1. Create a Navigation Bar

Start by adding a navigation bar at the top of the page. Use Bootstrap's Navbar component for this purpose.

Code Description
  • Navbar Structure: Utilizes Bootstrap classes such as navbar, navbar-expand-lg, navbar-light, and bg-light to create a navigation bar with responsive behavior and light background color.
  • Branding: <a> tag with the class navbar-brand is used to represent the branding or logo of the website within the navigation bar, styled by Bootstrap to maintain consistency.
  • Toggle Button:
    • <button> with the class navbar-toggler creates a toggle button for collapsing and expanding the navigation menu on smaller screens.
    • data-bs-toggle="collapse": Specifies the behavior of the button to toggle the collapse state of the target element.
    • data-bs-target="#navbarSupportedContent": Defines the target element to be collapsed or expanded, in this case, the collapsible content of the navigation bar.
  • Collapsible Content: <div> with classes collapse and navbar-collapse, along with the unique ID navbarSupportedContent, contains collapsible content of the navigation bar, making use of Bootstrap's collapse feature.
  • Navigation Links Container: <ul> with classes navbar-nav and ms-auto forms an unordered list to hold the navigation links, styled by Bootstrap to resemble a navigation menu and align links to the right (ms-auto).

2. Add Navigation Links

Within the navbar-nav class, add navigation links for the homepage, about me, experience, skills, and contact sections.

Code Description
  • Navigation Link Items: <li> elements with the class nav-item represent individual items within the navigation menu.
  • Navigation Links:
    • <a> tags with the class nav-link represent the navigation links within each list item.
    • Each link has an href attribute pointing to a specific section of the webpage indicated by the hash symbol followed by the section's ID (e.g., #about, #experience, #skills, #contact).

Result

html

index.html

css

index.css

js

index.js

Everything was clear?

Section 5. Chapter 3
course content

Course Content

Bootstrap: Building Stylish Websites

Building the Header NavigationBuilding the Header Navigation

1. Create a Navigation Bar

Start by adding a navigation bar at the top of the page. Use Bootstrap's Navbar component for this purpose.

Code Description
  • Navbar Structure: Utilizes Bootstrap classes such as navbar, navbar-expand-lg, navbar-light, and bg-light to create a navigation bar with responsive behavior and light background color.
  • Branding: <a> tag with the class navbar-brand is used to represent the branding or logo of the website within the navigation bar, styled by Bootstrap to maintain consistency.
  • Toggle Button:
    • <button> with the class navbar-toggler creates a toggle button for collapsing and expanding the navigation menu on smaller screens.
    • data-bs-toggle="collapse": Specifies the behavior of the button to toggle the collapse state of the target element.
    • data-bs-target="#navbarSupportedContent": Defines the target element to be collapsed or expanded, in this case, the collapsible content of the navigation bar.
  • Collapsible Content: <div> with classes collapse and navbar-collapse, along with the unique ID navbarSupportedContent, contains collapsible content of the navigation bar, making use of Bootstrap's collapse feature.
  • Navigation Links Container: <ul> with classes navbar-nav and ms-auto forms an unordered list to hold the navigation links, styled by Bootstrap to resemble a navigation menu and align links to the right (ms-auto).

2. Add Navigation Links

Within the navbar-nav class, add navigation links for the homepage, about me, experience, skills, and contact sections.

Code Description
  • Navigation Link Items: <li> elements with the class nav-item represent individual items within the navigation menu.
  • Navigation Links:
    • <a> tags with the class nav-link represent the navigation links within each list item.
    • Each link has an href attribute pointing to a specific section of the webpage indicated by the hash symbol followed by the section's ID (e.g., #about, #experience, #skills, #contact).

Result

html

index.html

css

index.css

js

index.js

Everything was clear?

Section 5. Chapter 3
some-alt