Bootstrap 5's Vertical Ruler

Is it possible to add a vertical line that extends down the right side of the listed items on this website? I want to place the main content next to this vertical line.

.first a.nav-link {
  background-color: #ebe0dd;
}

a.nav-link {
  font-size: 23px;
  font-family: 'Times New Roman', Times, serif;
  color: black;
  font-weight: lighter;
}

<div class="container d-flex flex-column flex-md-row">
    <nav class="navbar navbar-expand-md navbar-light d-flex flex-md-column">
      <button
      class = "navbar-toggler"
      type="button"
      data-bs-toggle="collapse"
      data-bs-target="#sidebar"
      aria-controls="sidebar"
      aria-expanded="false"
      aria-label="Toggle Navigation">

      <span class = "navbar-toggler-icon"></span>
      </button>

      

      <div class = "collapse navbar-collapse sidebar" id = "sidebar">
        <ul class = "navbar-nav w-750 my-3 d-flex  flex-md-column text-center ">
          <li class = "first"><a href="#" class = "nav-link" aria-current = "page">All</a></li>
          <li><a href="#" class = "nav-link">To Pay</a></li>
          <li><a href="#" class = "nav-link" >To Ship</a></li>
          <li><a href="#" class = "nav-link" >To Receive</a></li>
          <li><a href="#" class = "nav-link" >Completed</a></li>
          <li><a href="#" class = "nav-link" >Cancelled</a></li>
        </ul>
        
      </div>

    </nav>

</div>

Answer №1

Insert the border-end class into the ul element:

<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="31535e5e45424543504171041f001f02">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="eb8984849f989f998a9babdec5dac5d8">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>

<div class="container d-flex flex-column flex-md-row">
    <nav class="navbar navbar-expand navbar-light flex-column" style="height: 100vh;">
      <button
      class = "navbar-toggler"
      type="button"
      data-bs-toggle="collapse"
      data-bs-target="#sidebar"
      aria-controls="sidebar"
      aria-expanded="false"
      aria-label="Toggle Navigation">

      <span class = "navbar-toggler-icon"></span>
      </button>

      

      <div class = "collapse navbar-collapse sidebar" id="sidebar">
        <ul class = "navbar-nav h-100 w-750 my-3 d-flex  flex-column text-center border-end">
          <li class = "first"><a href="#" class = "nav-link" aria-current = "page">All</a></li>
          <li><a href="#" class = "nav-link">To Pay</a></li>
          <li><a href="#" class = "nav-link" >To Ship</a></li>
          <li><a href="#" class = "nav-link" >To Receive</a></li>
          <li><a href="#" class = "nav-link" >Completed</a></li>
          <li><a href="#" class = "nav-link" >Cancelled</a></li>
        </ul>
        
      </div>

    </nav>

</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Dynamic font size that adjusts as you change the window dimensions

Is there a way to adjust the font size in HTML so that when I resize the window, the text size adjusts accordingly? It's like setting a percentage for the text based on the size of the container it is in. Let me provide an example of what I have in m ...

What is the process for adjusting the font in my VS Code editor?

Currently diving into an Angular2 development video course, I stumbled upon something intriguing: https://i.stack.imgur.com/CIBcx.jpg Yes, aesthetically pleasing HTML attributes won't make me a coding genius. But let's be honest, who doesn&apos ...

Why don't inline style changes implemented by JavaScript function properly on mobile browsers like Chrome, Dolphin, and Android?

View the jsFiddle here Issue on PC/Windows browser: When performing action, h1 header "gif" disappears and video starts playing. Problem on mobile devices: The gif does not disappear as expected but the video still plays indicating that JavaScript is fun ...

Angular: Material Button that Adjusts According to Header Size

How can I adjust the size of a mat-icon to match the header size? Despite my efforts, the arrows remain small. <h1> <button mat-icon-button (click)="testEvent()"> <mat-icon>keyboard_arrow_up</mat-icon> < ...

Designing a unique CSS border for custom list item bullets

I'm currently exploring the possibility of implementing a CSS border around an image that I have imported as a custom bullet for my list items: ul { list-style: none; margin-right: 0; padding-left: 0; list-style-position: inside; } ul > ...

Styling elements with CSS and using it to toggle the visibility of divs based on radio

When the radio button #my102 is selected, the div #navi102 should be visible and all other #navi??? divs should be hidden. Similarly, if the radio button #my7 is selected, the div #navi7 should be visible and others hidden. What would be the best approach ...

Can you explain the contrast between onsubmit="submitForm();" and onsubmit="return submitForm();"?

Is it possible that the form below is causing double submissions? <form name="myForm" action="demo_form.asp" onsubmit="submitForm();" method="post"> function submitForm(){ document.myForm.submit(); } I've noticed a bug where sometimes two ...

Creating a polished and stylish centered responsive image with Bootstrap 3

I am facing an issue with centering a styled responsive image on my website. Upon debugging, I discovered that the class "portimage" is causing the responsiveness to break. My requirement is to ensure that the images do not exceed 700px in size and have a ...

I am having trouble getting pagify.js to function properly

Looking to incorporate the pagify.js plugin into my website by following the steps on Github. After downloading the repo, I tried opening the index page in Chrome for a preview, but encountered errors (see image). https://i.sstatic.net/WHOWS.png Need h ...

Leave your thoughts with HTML and Javascript coding

Currently, I am working on developing a comment box feature using HTML and JavaScript. I have encountered a question regarding how to implement a delete functionality for comments using a button. Would it be more efficient to utilize a linked list struct ...

Discovering the compiled CSS file in React when using Sass: A step-by-step guide

In my React project, I have incorporated SASS. Now I am looking to find the final compiled CSS file from that SASS code. Whenever I navigate to: While there is the SCSS file visible, where can I locate the CSS version? I am referring to the compiled outp ...

Swap out a paragraph with a city name fetched from a JSON file

While working on a weather app, I encountered an issue. The app needs to automatically detect the user's location and display the appropriate temperature along with the city name. I have been trying to fetch data from JSON to replace the placeholder t ...

Maintaining a child div with an aspect ratio of 16/9 to always fit within a parent div using CSS is proving to be a challenge

I am currently facing a challenge in adding a face overlay to an image while ensuring that the face remains within the inner div. The image is required to fit over a 16/9 ratio backdrop and also stay within the outer container. I have managed to achieve t ...

Issues with internal linking in TYPO3 are causing anchor tags to malfunction

When creating an internal anchor, it is usually defined using <a name="anchorname">Introduction</a>. To link to this anchor, you would write something like <a href="#anchorname">Top</a>. In TYPO3, an anchor is a ...

Dynamic menu bar accompanied by primary content

I'm facing an issue with my active navigation bar. Whenever I open the hamburger menu, the main content remains fixed and does not move along with the open navigation menu. I tried searching online for a solution but couldn't find anything helpfu ...

The data in MongoDB is organized using unique identifiers called ObjectId

I am currently working on a MEAN Crud project and encountering some issues. Despite the data being received in the mongodb, it is displaying as an objectId instead of the actual content. You can see this issue in the image below: https://i.stack.imgur.com ...

The void on the right side of the Safari browser

I am seeking assistance as I have encountered a problem on my website built using bootstrap 4.1. You can find my website at . The site functions correctly in chrome, firefox, opera, and IE, but when viewed on Safari, there is an unexpected white space on t ...

Creating a customized tooltip without the need for calling $(document).foundation() and using modernizr

I'm facing an issue with initializing the foundation tool-tip without having to initialize everything (such as $(document).foundation()). It seems like a simple task, but I am struggling. I have two questions in mind: (1) How can I utilize new Founda ...

What is the best way to arrange 4 resizable divs in a horizontal layout?

I need to create a search feature with a specific layout: [Search Input (visible when search icon is clicked)] SearchIcon ClearIcon RefreshIcon All arranged in a horizontal layout. I have created a directive (called my-search) to combine the search inpu ...

Attempting to create a responsive design for profile pictures and texts

Seeking advice on making my profile picture and About me text responsive, utilizing Bootstrap v5 with percentages for responsiveness. Wondering if there is a more efficient way to ensure the profile picture looks good on phones, tablets, and 1080p screens. ...