Hover Menu - No Wrap Submenu Items

/ Published in: CSS
Save to your folder(s)

When creating a drop-down menu/hover menu, the subitems will usually go as wide as the parent li. To make them go as wide as the value of their containing li you have to add a white-space: nowrap.

If you still run into issues you may have to make sure you've assigned display:block to the li that is wrapping also.

Copy this code and paste it in your HTML
  1. ul li li{
  2. display: block;
  3. white-space: nowrap;
  4. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.