Prevent flexbox list items changing width of parent when hover over children
I have a series of list items and some have a child list, containing sub navigation links. I'm using CSS to create a hover effect by having display: none on the child <ul> and then setting to display: block when hovering. However this has the undesired effect of making the parent <li> grow during hover. Is there a way to prevent this? When hovering over the <li> items that have no child lists then their width remains the same. <ul class="flex unstyled-list"> <li><a href="/">link</a></li> <li><a href="/" target="_blank">link 2</a></li> <li> <a href="/">parent 1</a> <ul class="unstyled-list">