DEVHIDE
  • Home (current)
  • About
  • Contact
  • Cookie
  • Home (current)
  • About
  • Contact
  • Cookie
  • Disclaimer
  • Privacy
  • TOS
Login Or Sign up

CSS3 Flip Dropdown Menu - Retain main-menu hover style when hovering over sub-menu

1.6k Views Asked by user3413870 At 25 June 2015 at 13:52 2025-12-08T18:10:58.468090

Here's the fiddle for my query

https://jsfiddle.net/e7te8hf1/

<section id="action-bar">
<div id="logo">
<a href="#"><img src="img/logo.png"></a>
</div><!-- end logo -->

<nav class="navbar navigation main-navigation">
<ul class='menu main-menu'>
<li class='menu-item'>
<a href="#" class="three-d">
<span title='Women'>Women</span>
</a>
<ul>
<li>
<a href="casuals.html">Casuals</a>
<ul>
<li><a href="tops.html">Tops</a></li>
<li><a href="bottoms.html">Bottoms</a></li>
<li><a href="suits.html">Suits</a></li>
<li><a href="jumpsuits.html">Jumpsuits</a></li>
</ul>
</li>
<li><a href="formals.html">Formals</a></li>
<li>
<a href="prints.html">Prints</a>
<ul>
<li><a href="stitched.html">Stitched</a></li>
</ul>
</li>
<li><a href="anokhee.html">Anokhee</a></li>
<li><a href="abbayas.html">Abbayas</a></li>
<li>
<a href="accessories.html">Accessories</a>
<ul>
<li><a href="bags.html">Bags</a></li>
<li><a href="pouch.html">Pouch</a></li>
<li><a href="dupatta.html">Dupatta</a></li>
<li><a href="stole.html">Stole</a></li>
<li><a href="clutches.html">Clutches</a></li>
</ul>
</li>
</ul>
</li>
<li class='menu-item'>
<a href="#" class="three-d">
<span title='Men'>Men</span>
</a>
<ul>
<li>
<a href="casual.html">Casual</a>
<ul>
<li><a href="tops.html">Tops</a></li>
<li><a href="bottoms.html">Bottoms</a></li>
<li><a href="suits.html">Suits</a></li>
</ul>
</li>
<li><a href="formal.html">Formal</a></li>
</ul>
</li>
<li class='menu-item'><a href="#" class="three-d"><span title='Look Book'>Look Book</span></a></li>
<li class='menu-item'><a href="#" class="three-d"><span title='Stores'>Stores</span></a></li>
<li class='menu-item'><a href="#" class="three-d"><span title='Contact'>Contact</span></a></li>                         
</ul>
</nav>
</section>

and the CSS is

#action-bar .navbar {
    float: left;
}
#action-bar nav ul ul {
    display: none;
}
#action-bar nav ul li:hover > ul {
    display: block;
}
#action-bar nav ul {
    background: #fff;
    padding: 0;
    list-style: none;
    position: relative;
    display: inline-table;
    margin: 0;
    text-align: center;
    font-size: 15px;
    font-family:'Oswald', sans-serif;
    font-weight: bold;
}
#action-bar nav ul:after {
    content:"";
    clear: both;
    display: block;
}
#action-bar nav ul li {
    float: left;
}
#action-bar nav ul li:hover {
    background: #6f100d;
}
#action-bar nav ul li a {
    display: block;
    color: #757575;
    text-decoration: none;
    border-right: 1px solid #E5E5E6;
    border-bottom: 1px solid #E5E5E6;
    transition: .8s background-color;
}
#action-bar nav ul li a:hover {
    color: #fff;
}
#action-bar nav ul ul {
    background: #fff;
    padding: 0;
    position: absolute;
    top: 100%;
}
#action-bar nav ul ul li a {
    color: black;
}
#action-bar nav ul ul li {
    float: none;
    position: relative;
}
#action-bar nav ul ul li a {
    padding: 15px 40px;
    color: black;
}
#action-bar nav ul ul li a:hover {
    background: #6ABED6;
    color: #fff;
}
#action-bar nav ul ul ul {
    position: absolute;
    left: 100%;
    top:0;
}
#action-bar nav ul li:hover > a {
    color: #fff;
}
#action-bar #view-cart {
    float: right;
    display: inline-block;
    padding-top: 18px;
    padding-left: 5px;
}
#action-bar #user-menu {
    display: inline-block;
    padding-left: 160px;
}
.menu .menu-item {
    display: inline-block;
    margin: 0;
    padding: 0;
}
.main-menu .menu-item a {
    color: #fff;
    display: block;
    text-decoration: none;
    font-family:'Oswald:500', Arial, sans-serif;
    font-smoothing: antialiased;
    text-transform: uppercase;
    overflow: visible;
    background: #fff;
}
.three-d span, .three-d span::before, .three-d span::after {
    display: block;
    transition: all .3s ease-out;
    transform-style: preserve-3d;
}
.three-d {
    position: relative;
    cursor: pointer;
    transition: all .07s linear;
}
.three-d span {
    display: block;
    padding: 18px 35px;
    perspective: -200px;
}
.three-d span::before, .three-d span::after {
    padding: 18px 35px;
    content: attr(title);
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: #fff;
    box-sizing: border-box;
}
.three-d span::before {
    transform: rotateX(0deg) translateZ(25px);
}
.three-d span::after {
    transform: rotateX(-90deg) translateZ(25px);
    background: #6f100d;
    color: #f9f9f9;
}
.three-d:hover span, .three-d:focus span {
    transform: translateZ(-25px) rotateX(90deg);
}

I want the main-menu to retain the hover style when I hover over the sub-menu, using CSS, but I am unable to achieve that.

Can anyone please help?

javascript html css flip
Original Q&A
1

There are 1 best solutions below

1
Turnip Turnip On 25 June 2015 at 14:04 BEST ANSWER

Change the last block of CSS...

.three-d:hover span, .three-d:focus span {
    transform: translateZ(-25px) rotateX(90deg);
}

to this...

li:hover .three-d span, .three-d:focus span {
    transform: translateZ(-25px) rotateX(90deg);
}

and change the rest of your a:hover { selectors to li:hover > a {

JSFIDDLE

Related Questions in JAVASCRIPT

  • Angular Show All When No Filter Is Supplied
  • Why does a function show up as not defined
  • I count the time the user takes to solve my quiz using Javascript but I want the same time displayed on another page
  • Set "More" "Less" font size
  • Using pagination on a table in AngularJS
  • How to sort these using Javascript or Jquery Most effectively
  • how to fill out the table with next values in array with one button
  • State with different subviews
  • Ajax jQuery firing multiple time display event for the same result
  • Getting and passing MVC Model data to AngularJS controller
  • Disable variable in eval
  • javascript nested loops waiting for user input
  • .hover() seems to overwrite .click()
  • How to sort a multi-dimensional array by the second array in descending order?
  • How do I find the fonts that are not loading in a CORS situation ( MoovWeb )?

Related Questions in HTML

  • Delay in loading Html Page(WebView) from assets folder in real android device
  • Why does a function show up as not defined
  • CSS Class is not applying to element (border width,color,and style attributes)
  • How to sort these using Javascript or Jquery Most effectively
  • how to fill out the table with next values in array with one button
  • Automatically closing tags in form input?
  • Positioning child at bottom of parent with scroll
  • Remove added set of rows
  • Website zoomed out on Android default browser
  • Twitter Bootstrap horizontal form elements on a line
  • http://sigmajs.org/ les mis tutorial - why are my canvases 0 height?
  • My navbar is not expanding after collapse
  • when a checkbox is checked how to display a different hidden element using javascript
  • Gaps Vertically Using Dividers
  • Svg containers not positioning properly

Related Questions in CSS

  • CSS Class is not applying to element (border width,color,and style attributes)
  • How do I find the fonts that are not loading in a CORS situation ( MoovWeb )?
  • Positioning child at bottom of parent with scroll
  • Play multiple audio files in a slider
  • How to set text over image?
  • Website zoomed out on Android default browser
  • Writing/Overwriting to specific XML file from ASP.NET code behind
  • My navbar is not expanding after collapse
  • when a checkbox is checked how to display a different hidden element using javascript
  • Gaps Vertically Using Dividers
  • CSS: Preventing a property to affect on element until the end of transition
  • Polygon Button with pure CSS
  • transform-origin doesnt apply in safari
  • show/hide multiple div tags at once and change the size of the remaining div tag
  • Mask the image/maps/div (circle) using css and jquery

Related Questions in FLIP

  • Using muPDF with curl/flip effect
  • Revert flipping a DIV after clicking another one
  • CSS3 Flip Dropdown Menu - Retain main-menu hover style when hovering over sub-menu
  • C# PictureBox rotate vertical
  • CSS Flip Transition Effect - Absolute Positioning Breaks Responsiveness
  • Divide windows form into 4 section and view diffrent orientation panel in each section
  • How to identify android phone flip 180 degrees
  • How to flip an image in Xamarin Android?
  • css flipped block interaction with non flipped, only webkit specific
  • Animation like cards app iphone
  • Image flipping incorrectly...Why?
  • How to flip two views in tableviewcell
  • c# unity flpping y axis on rotation player goes upside-down
  • c# unity error can't flip my submarine on its y axis
  • Android Page Curl Animation

Trending Questions

  • UIImageView Frame Doesn't Reflect Constraints
  • Is it possible to use adb commands to click on a view by finding its ID?
  • How to create a new web character symbol recognizable by html/javascript?
  • Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
  • Heap Gives Page Fault
  • Connect ffmpeg to Visual Studio 2008
  • Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
  • How to avoid default initialization of objects in std::vector?
  • second argument of the command line arguments in a format other than char** argv or char* argv[]
  • How to improve efficiency of algorithm which generates next lexicographic permutation?
  • Navigating to the another actvity app getting crash in android
  • How to read the particular message format in android and store in sqlite database?
  • Resetting inventory status after order is cancelled
  • Efficiently compute powers of X in SSE/AVX
  • Insert into an external database using ajax and php : POST 500 (Internal Server Error)

Popular # Hahtags

javascript python java c# php android html jquery c++ css ios sql mysql r reactjs

Popular Questions

  • How do I undo the most recent local commits in Git?
  • How can I remove a specific item from an array in JavaScript?
  • How do I delete a Git branch locally and remotely?
  • Find all files containing a specific text (string) on Linux?
  • How do I revert a Git repository to a previous commit?
  • How do I create an HTML button that acts like a link?
  • How do I check out a remote Git branch?
  • How do I force "git pull" to overwrite local files?
  • How do I list all files of a directory?
  • How to check whether a string contains a substring in JavaScript?
  • How do I redirect to another webpage?
  • How can I iterate over rows in a Pandas DataFrame?
  • How do I convert a String to an int in Java?
  • Does Python have a string 'contains' substring method?
  • How do I check if a string contains a specific word?
.

Copyright © 2021 Jogjafile Inc.

  • Disclaimer
  • Privacy
  • TOS
  • Homegardensmart
  • Math
  • Aftereffectstemplates