I made it so that when you hover over a link in the navigation menu, the background appears ... I want to change the size of this background, and something does not work. Neither height
, nor width
, nor background-size
work, what could be the problem?
Here is what I write:
nav ul li a:hover{ background: #e7e7e7; border-radius: 10px; background-size: 450px; }
By the way, not a single parameter in the background-size
works, neither %
, nor px
, nor cover
... Where can I find the problem?
Here is a screen that shows a:hover
, the size of which I want to change:
(source: screenshot.ru )
HTML:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Effektiv Fox</title> <link href="styles/main.css" rel="stylesheet" type="text/css"> </head> <body> <header> <nav> <ul class="navigation"> <li><a href="#">О нас</a></li> <li><a href="#">Цены</a></li> <li><a href="#">Условия</a></li> <li><a href="#">Контакты</a></li> <li><a href="#">История</a></li> </ul> <a id="foximg" href="index.html"><img src="fox.png" alt="effektiv fox" align="right"></a> </nav> </header> <div id="mainboard"> <br> osdadsadadas </div> <footer></footer> </body> </html>
CSS:
body { background: #dedede; text-align: center; } header{ background: #bababa; width: 1000px; height: 50px; margin: 0 auto; text-align: left; } nav ul li { display: inline-block; list-style-type: none; padding: 0; font-family: verdana; font-size: 18,89px; color: #7a7a7a; } nav ul li a{ padding: 10px; text-decoration: none; color: #707070; } nav ul li a:hover{ background: #e7e7e7; border-radius: 10px; background-size: 450px; } #mainboard { background: #e7e7e7; height: 1000px; /* Высота блока */ width: 1000px; /* Ширина блока */ margin: 0 auto; text-align: left; word-break: break-all; } .navigation { margin: 0; padding: 22px 0px 0px 20px; } #foximg { top: 1px; /* Расстояние от нижнего края окна браузера */ position: absolute; /* Абсолютное позиционирование */ left: 1365px; }