List with a blue left border using CSS


To add a blue left border to a list in CSS, you can try to run the following code −

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         ul {
            border-left: 3px solid blue;
            background-color: #gray;
         }
      </style>
   </head>
   <body>
      <p>Countries</p>
      <ul>
         <li>India</li>
         <li>US</li>
         <li>Australia</li>
      </ul>
   </body>
</html>

Output

Updated on: 22-Jun-2020

112 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements