Dashed line only css?

Asked

Viewed 1,799 times

2

does anyone know how to make this dashed line only with css? I tried with images but could not thank you!
inserir a descrição da imagem aqui

  • Dashed as? By the image you can not understand.

  • You can use border-style:dashed, but it won’t look like the image. https://developer.mozilla.org/en-US/docs/Web/CSS/border-style

  • Why can only be with css? Using two span tags to smoothly play with border-style.

2 answers

3

To do with linear-gradient

.linha {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #48958C;
    font-size: 2.5rem;
    position: relative;
}
.linha::after {
   content: '';
   position: absolute;
   width: 6rem;
   height: 0.2rem;
   top: 100%;
   left: 0.25rem;
   background: linear-gradient(to right,#48958C 0%, #48958C 15%, transparent 15%, transparent 30%, #48958C 30%)
}
<p class="linha">Conheça o projeto</p>

3


If you want to trace the shape placed in the question image, you can create a class with the pseudo-elements ::before and ::after:

/* tirei o underline do "a" apenas para exemplificar no resultado*/
a{
   text-decoration: none;
}

.trasso{
   position: relative;
}

.trasso::before,
.trasso::after{
   content: '';
   border-bottom: 2px solid #090;
   position: absolute;
   top: 100%;
}

.trasso::before{
   width: 5px;
   left: 0;
}

.trasso::after{
   width: 30px;
   left: 10px;
}
<div>
   <p class="trasso">Conheça o projeto</p>
   <a href="#" class="trasso">Conheça o projeto</a>
</div>

Browser other questions tagged

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