# Image Exercise Menu Advanced

**URL:** <https://forum.codewithmosh.com/t/image-exercise-menu-advanced/9195>\
**Category:** HTML/CSS\
**Created:** [December 15, 2021, 5:20am UTC](https://forum.codewithmosh.com/t/image-exercise-menu-advanced/9195 "2021-12-15T05:20:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Estevitan](https://avatars.discourse-cdn.com/v4/letter/e/ecb155/32.png) [@Estevitan](https://forum.codewithmosh.com/u/Estevitan)\
**Post date:** [December 15, 2021, 5:20am UTC](https://forum.codewithmosh.com/t/image-exercise-menu-advanced/9195/1 "2021-12-15T05:20:57Z")

</div>

So I’m seeing that when I use flexbox for the menu when I use the hover code  
.menu li:hover,

.menu .active {

background-color: #211b2a;

color: #fff;

display: block;

I get a change in the background but it isn’t the same length as the container’s background.  
when I just get rid of flexbox in the display it seems to be fine and I get a similar result as the solution. However I was just curious if there was a way to use flexbox with this similar code to make it when I hover over the menu item or have it active… that it will match the background width of the container element. So far I’ve just made the width okay on a mobile screen and set the hover element to 100vw but when I change to larger widths and the menu background width becomes 20% i cant get a good responsive css code that will match the changing color hover bar to be just as wide when I adjust the screen size.

 ![mismatchingmenuhover](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/b/b7e26410b16429854859d408c490bdc38984a9d4.jpeg)
