Integrating background designs for enhancing menu and dropdown elements

Is there a way to create a menu with a dropdown feature? I am looking to merge the background of the main menu and the dropdown together, similar to the image below. Can anyone provide assistance?

Here is an example of what I am trying to achieve:

http://s1369.photobucket.com/user/ashast1/media/Capture_zps0b0c58e6.png.html

Additionally, here is a jsfiddle link for reference:

http://jsfiddle.net/6KPXC/

Answer №1

Check out this interactive demo

.nav ul{list-style-type:none; position:relative;}
.nav ul li{position:relative; text-transform:uppercase; display:inline-block;}
.nav ul li:hover a{border:1px solid #d7d7d7;background:#fff;color:#f9852b; border-bottom:none;}
.nav ul li a{position: relative; padding:10px; color:#5E6062; display:block;border:1px solid #fff; z-index: 100;}
.nav ul li a:hover{position: relative; color:#f9852b;border:1px solid #d7d7d7; z-index:11; border-bottom:none;}
.nav ul li:hover ul{display:block;padding:20px;}
.nav ul ul{position:absolute; display:none; min-width: 200px; border:1px solid #d7d7d7; border-top: none; margin-top:-1px;left:-10px;z-index:10;}
.nav ul ul:after{position: absolute; content: ""; top: 0; right: 0; width: 100%; border-top:1px solid #d7d7d7;}
.nav ul ul li a, .nav li:hover li a{border:0px; color:#515151; text-transform:capitalize;padding:3px 10px;}
.nav ul ul li a:hover, .nav li:hover li a:hover{border:none; color:#515151; text-decoration:underline;}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Discover the method for selecting an element within a table that includes a style attribute with padding using Jquery

Looking for a way to identify a td element with the padding style in a table I've attempted to locate a td element with the padding style attribute in a table $(Table).find('td[style="padding:"]') or $(Table).find('td[style] ...

Using JQuery datepicker() with CSS class in ASP.net for dynamically generated TemplateFields

I have implemented TemplateFields in a Gridview to dynamically create textboxes as records are added. However, due to the limitation of not being able to have ASP controls with the same ID's, using ClientIDMode=Static is not an option for these contro ...

The scrolling speed of my news div is currently slow, and I am looking to increase its

This is the news div with bottom to top scrolling, but it is slow to start scrolling. I want to increase the speed. The current behavior is the div appears from the y-axis of the system, but I want it to start exactly where I define. The scrolling div is ...

Designing tables for email marketing

I've been researching the best way to style tables in my emails on the internet. From what I understand, CSS can be tricky when it comes to email formatting. So, when it comes to styling tables, is it better to use CSS or HTML? Should I opt for cod ...

What is the best way to specifically target header elements within article elements using a CSS selector?

As someone who is not well-versed in CSS, I am looking to target specifically the header elements within article elements. I have some understanding of selectors such as #, ., or ,. article header article, header article.header article#header I believe t ...

Facing a dilemma: Javascript not updating HTML image source

I am facing an issue while attempting to modify the source of my HTML image element. Despite using document.getElementId('image') in my code, I am unable to make it work as intended. Surprisingly, there are no errors displayed. Interestingly, whe ...

The specified width and height for a div containing images are not being accepted by Firefox

I am facing an issue with the CSS for a div that contains images and is not displaying any width: .wide{ width:5000px; height:100%; overflow: hidden; z-index: 1; display:none; } Here is the HTML code for the div: <div class="wide ...

Animation of a floating string in Three.js

I am seeking a creative way to incorporate an intriguing effect into my project. Specifically, I envision drawing a floating line with dynamic curves and interactive hover effects. To provide a visual reference, the project timeline featured on the home p ...

What is the best way to refresh templates (html) when deploying a new version of a SPA?

I'm facing an issue with caching of HTML templates in the browser when releasing new versions of my Single Page Application (SPA). My SPA is built with Angular 1.5, ocLazyload, and ui-router. I have set up gulp tasks to implement cache-busting using ...

Choosing from a dropdown menu by pressing keys

When I press the first letter of an option in my dropdown list, it works fine. However, if I try to press two, three, or four letters consecutively, the control vanishes. For example, if the option is 'Jquery' and I press J only, it works but pre ...

Customize the color of the horizontal line in React using dynamic properties

Is there a way to customize the color of an <hr /> element in a React application? If we were to use a functional component to accomplish this, how would we go about it? ...

What is the best way to assign a JavaScript return value to a PHP variable?

Is it possible to capture the return value of a JavaScript function that checks if text boxes are empty and assign it to a PHP variable? I have successfully created a JavaScript function that returns false if any of the text boxes are empty, but now I ne ...

Why do HTML elements in an email have strange prefixes added to their IDs?

Currently, I am working on setting up automated tests for my service that automatically sends email reports. The objective is to verify the accuracy of data in the emails. To accomplish this, I have started assigning unique IDs to different HTML elements ...

Dynamic SVG positioning

Looking for a way to make this svg shape relative to its containing div? Fiddle: http://jsfiddle.net/8421w8hc/20/ <div> <svg viewBox="0 0 1000 2112" style="" xmlns="http://www.w3.org/2000/svg" version="1.1"> <path id="ma" st ...

Employing JavaScript for fading divs in and out sequentially

Hey there! I'm currently struggling with implementing transitions for my tool tips. Any assistance would be greatly appreciated! I am looking to have my "fader" divs fade in and out on click of a button, with each transition lasting 5 seconds. It&apo ...

jQuery Mobile dual range slider functioning but experiencing some glitches

I successfully created a dual range slider by stacking two sliders on top of each other using the jQuery Mobile framework. In addition, I have implemented JavaScript to ensure that the left thumb does not exceed the right one. However, I have encountered ...

Challenges with Adjusting Background Opacity in CSS

My text has a white background with an opacity of .3, but it's affecting the foreground due to CSS repositioning. Even though the HTML is in a different division, I struggle with certain aspects of CSS and would appreciate guidance from those more exp ...

Optimizing Bootstrap 4 Flex-Row Dimensions

Issue: I'm currently working on a relatively intricate ListGroup using bootstrap v4. The .flex-row div is displaying some mysterious white space at the bottom, and I need assistance in eliminating it. Attempts Made So Far: I've experimented w ...

Is it possible to transfer the style object from PaperProps to makeStyles in Material UI?

I am working with a Material UI Menu component and attempting to customize its border. Currently, I am only able to achieve this customization by using PaperProps inline on the Menu element. However, I already have a makeStyles object defined. Is there a ...

How can I prevent the interpolation of "${variable}" in HTML when using AngularJS?

I need to display the string ${date} in a div element: <div>please substitute the ${date} as the tag for the name</div> The displayed content should be: please use the ${date} as the substitute tag to the name. However, the browser interpre ...