S
S
sined99332019-01-27 13:24:51
css
sined9933, 2019-01-27 13:24:51

A block span does not take on the effects of a:hover. How to fix?

There is the following code:

nav a {
  display:block;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.6);
}
nav a:hover {
  color:#fff;

}
nav a span {
  width: 5px;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.6);
  position: absolute;
  right:0;
  bottom: 30px;
  transform: rotate(45deg);
}

When you hover over a link, the color of the span element does not change, I saw some people still put it in the tag , but I did not fully understand how it works. Prompt how to force to adopt such span effect from a:hover.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RMate, 2019-01-27
@RMate

you need to do this -

a:hover span {
 ...стили...
}

A
A person from Kazakhstan, 2019-01-27
@LenovoId

In general, your span is not a block one, but a block one, you have a link tag and, accordingly, everything that you wrote for the span will not work ..

width: 5px; не сработает 
  height: 2px; не сработает
  background-color: rgba(255, 255, 255, 0.6); сработает
  position: absolute; сработает
  right:0; сработает
  bottom: 30px; сработает 
  transform: rotate(45deg); не сработает

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question