Create bar with CSS

Asked

Viewed 56 times

3

A client asked to create a menu based on the image below:

inserir a descrição da imagem aqui

How could I make these bars with CSS? I’m using Bootstrap for development.

<div class="collapse navbar-collapse" id="navbarSupportedContent">
 <ul class="navbar-nav mr-auto main-nav-left">
   <li class="nav-item">Home</li>
   <li class="nav-item">Esportes</li>
   <li class="nav-item">Masculino</li>
   <li class="nav-item">Feminino</li>
   <li class="nav-item">Crianças</li>
   <li class="nav-item">Outlet</li>
   <li class="nav-item">Lançamentos</li>
 </ul>
</div>

1 answer

5


I made this option using only the character / but you can create the element you want in ::after of LI

inserir a descrição da imagem aqui

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}
ul {
  padding: 10px 0;
  color: #fff;
  margin: auto;
  list-style: none;
  display: flex;
  background-color: green;
  justify-content: center;
}
li {
  position: relative;
}
li:not(:last-child):after {
  content: "/";
  margin-left: 20px;
  margin-right: 20px;
}
<div class="collapse navbar-collapse" id="navbarSupportedContent">
  <ul class="navbar-nav mr-auto main-nav-left">
    <li class="nav-item">Home</li>
    <li class="nav-item">Esportes</li>
    <li class="nav-item">Masculino</li>
    <li class="nav-item">Feminino</li>
    <li class="nav-item">Crianças</li>
    <li class="nav-item">Outlet</li>
    <li class="nav-item">Lançamentos</li>
  </ul>
</div>

  • 1

    Perfect, Hugo. Thank you very much!

  • @Fox.11 no problem my dear

Browser other questions tagged

You are not signed in. Login or sign up in order to post.