Show the after after after the Hover

Asked

Viewed 163 times

1

I’m having a doubt, I’m developing a site based on a layout in PSD and the main menu, it has a Hover that makes an underscore kind of customized: inserir a descrição da imagem aqui

I thought of putting as after and when I did the Hover, it would appear, but I’m having difficulties in that, I don’t know if it’s the best solution too.

Any tips on how to solve?

  • 2

    Try it like this: .classe:hover::before { // aqui o seu estilo }

  • Your doubt is about the underlined in the text?

  • @Douglasgarrido It worked, thank you very much!!!

  • @Williantártaro I will post as reply then. Just mark as correct.

2 answers

1

I did this experiment. You can try something similar.

body {
  background: #000;
}

a {
  text-decoration: none;
  color: #FFF;
  padding: 20px 25px;
  margin: 40px auto;
}

a:hover::after {
  content: "";
  width: 150px;
  height: 1px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(147, 147, 147, 1) 50%, rgba(0, 0, 0, 0) 100%);
  display: block;
  margin-bottom: 10px;
  margin-top: 10px;
}
<p><a href="#">A STARMILK</a></p>

0

You can use the following style in your CSS:

.classe:hover::before {
    // aqui vai o seu estilo
}

Browser other questions tagged

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