• 0

CSS - Border on a drop down menu


Question

Hello all,

Ive got the following CSS drop down menu here which is working fine.

However, im trying to achieve something like eBay where, if you hover over the menu on the top right an border appears around the menu item, and the drop down.

I thought this would be simple enough - put a solid black border around the drop down, and then a black border around the left, top and right of the menu item and set the bottom border to be white - to "cover up" the border-top of the drop down. However, despite the z-index, the drop down always appears ontop of the menu item and i cant achieve the effect im looking for.

Would appreciate some help

Thanks

Link to comment
https://www.neowin.net/forum/topic/926142-css-border-on-a-drop-down-menu/
Share on other sites

8 answers to this question

Recommended Posts

  • 0
  On 02/08/2010 at 17:49, Cupcakes said:

For example:

 ul.products {
left 87px;
border: 1px solid #000;
margin-top: -1px;
}

You will also need to change add z-index (on the nested UL and the parent UL) so it appears behind it's parent list item.

Thanks for the reply.

Thanks what i was kind of doing though. Have a look again (ignoring the annoying inheritance)

With regards to the z-index - im confused! ul.menu li:hover has a z-index of 599 (highest value), yet it still appears below ul.menu ul (with a z-index of 598)?!

Thanks for the help

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • If its anything like the TV licence they will send a few men around knocking and a letter every week saying they will take you to court.
    • New leak shows the design of the upcoming Nothing Headphone (1) by David Uzondu We've been hearing about the Nothing Headphone (1) for a while now, and it looks like we finally have our first real look at the headphones. In a new series of images leaked by @nothing_fan_blog on Instagram, the self-proclaimed "official German Nothing Fanpage", we can see Nothing's first over-ear headphones out in the wild. You definitely will not mistake these for anything else on a store shelf. The design has the company's signature see-through aesthetic, with a transparent oval piece on top of a solid rectangular base on the earcups, with three physical buttons for controls. Image via @nothing_fan_blog The headphones are set to launch alongside the Phone (3), which itself is getting rid of the glyph interface that made the company's phones stand out in the first place. It is a bit interesting seeing the new headphones establishing a strong visual identity while the flagship phone abandons its own. There is good news for anyone who values a wired connection for audio quality, as one of the images confirms the presence of a 3.5mm headphone jack. On the other hand, a close-up of the headband shows no visible folding hinges, which could be a minor inconvenience for some people, especially travelers. Image via @nothing_fan_blog As for colors, the leaks reveal both a white and black version. There's reportedly a gray option, but the leaked images did not show that. The more interesting part is the price, which is rumored to come in around $299 in the US and €299 in Europe. This would place the Headphone (1) in a very aggressive position, undercutting top-tier options from Sony and Bose by a significant margin. To compete, they will have to pack in the usual like Active Noise Cancellation. The sound quality also needs to be excellent, so let's hope the previously announced partnership with British audio company KEF works out well. We still don't have other details like battery life or specific driver information. Full details are expected at the official launch event, happening on July 1.
    • Ads in WhatsApp? Is this serious? The day that happens is the day I stop using WhatsApp permanently.
    • "When Live Activities launched with iOS 16, Apple gave iPhone users a dynamic way to track stuff like sports scores and food deliveries right on the lock screen." No.... Just no... Life is already noisy enough to have my phone ADD notifications to the existing ones all day long.
    • Samsung Electronics has multiple subsidiaries. Samsung Display is a subsidiary that deals in screen manufacturing, it's a supply chain-based company where the staff solely care about manufacturing displays. Samsung Electronic's TV and Phone division may have other priorities, for example Samsung TV didn't want to go in on OLED because margins were lower when building the entire TV. Samsung Display's entire existence however now depends on OLED as they couldn't undercut Chinese LCD manufacturers but could compete against LG Display who is the only competitor in that market. Samsung Display has this screen manufacturing investment, but Samsung Mobile may not be willing to reduce their margins for going with a display technology that eats into the phone margins.
  • Recent Achievements

    • Week One Done
      Crunchy6 earned a badge
      Week One Done
    • One Month Later
      KynanSEIT earned a badge
      One Month Later
    • One Month Later
      gowtham07 earned a badge
      One Month Later
    • Collaborator
      lethalman went up a rank
      Collaborator
    • Week One Done
      Wayne Robinson earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      674
    2. 2
      ATLien_0
      274
    3. 3
      Michael Scrip
      219
    4. 4
      +FloatingFatMan
      170
    5. 5
      Steven P.
      161
  • Tell a friend

    Love Neowin? Tell a friend!