Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7009685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:53:37+00:00 2026-05-27T21:53:37+00:00

FIXED change #media a to #media > a, so it will select only the

  • 0

FIXED
change #media a to #media > a, so it will select only the direct child and not all sub-children
Thanks to Zoltan Toth

I have made a drop down menu with HTML and CSS.
The text ‘onze media’ – ‘adverteren’ are actually images and no plain text.

At ‘onze media’ I’ve set some drop menu under ‘onze media’ but the ‘onze media’ image is loaded on every line. It’s supposed to be only at the top, so the first main button needs to be ‘onze media’

How to fix this?

HTML

<ul id="drop-down-menu">
  <li id="home"><a href=""></a></li> 
  <li id="media"><a href=""></a> 
    <ul>
      <li id="1a"><a href="">Blabla</a></li>
      <li id="1b"><a href="">Blabla Beauty</a></li> 
      <li id="1c"><a href="">Blabla Slijterij</a></li>
      <li id="1d"><a href="">Blabla</a></li>
      <li id="1e"><a href="">Blabla App</a></li> 
      <li id="1f"><a href="">Blabla.nl</a></li>
      <li id="1g"><a href="">Blabla.nl</a></li>
      <li id="1h"><a href="">Blabla.nl</a></li>
    </ul> 
  </li> 
  <li id="ad"><a href=""></a></li>
  <li id="ons"><a href=""></a></li> 
  <li id="co"><a href=""></a></li> 
</ul>

CSS

#drop-down-menu{
}
ul{
  margin:0;
  padding:0;
  list-style:none;
}
ul li{
  display:block;
  position:relative;
  float:left
}
li ul{
  display:none
}
ul li a{
  display:block;
  margin-left:1px;
  text-decoration:none;
  padding: 5px 15px 5px 15px;
  white-space:nowrap;
}
ul li a:hover{
  color:inherit;
}
li:hover ul{ 
  display:block; 
  position:absolute;
}
li:hover li{ 
  font-size:70%;
  clear:left; 
  width:12em;
}
li:hover a{
  color:inherit;
}
li:hover li a:hover{
  color:inherit;
}
.clear_all{
  clear:both;
  height:0.5em;
}
#home a{
  height:55px;
  width:206px;
  background-repeat:no-repeat;
  background-image : URL(images/menu/home_normal.png );
}   
#home a:hover{
  height:55px;
  width:206px;
  background-repeat:no-repeat;
  background-image : URL(images/menu/home_selected.png );
}
#media a{
  height:49px;
  width:85px;
  background-repeat:no-repeat;
  background-image : URL(images/menu/media_normal.png );
}   
#media a:hover{
  height:49px;
  width:85px;
  background-repeat:no-repeat;
  background-image : URL(images/menu/media_selected.png );
}
#ad a{
  height:49px;
  width:90px;
  background-repeat:no-repeat;
  background-image : URL(images/menu/ad_normal.png );
}   
#ad a:hover{
  height:49px;
  width:90px;
  background-repeat:no-repeat;
  background-image : URL(images/menu/ad_selected.png );
}
#ons a{
  height:49px;
  width:69px;
  background-repeat:no-repeat;
  background-image : URL(images/menu/over_normal.png );
}   
#ons a:hover{
  height:49px;
  width:69px;
  background-repeat:no-repeat;
  background-image : URL(images/menu/over_selected.png );
}
#co a{
  height:49px;
  width:65px;
  background-repeat:no-repeat;
  background-image : URL(images/menu/contact_normal.png );
}   
#co a:hover{
  height:49px;
  width:65px;
  background-repeat:no-repeat;
  background-image : URL(images/menu/contact_selected.png );
}

Image

enter image description here

When changing #media a to #media > a the main image will be fixed but how do I change position and images of the sub links?

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:53:37+00:00Added an answer on May 27, 2026 at 9:53 pm

    change #media a and #media a:hover to #media > a and #media > a:hover, so it will select only the direct child and not all sub-children

    #media a{
      height:49px;
      width:85px;
      background-repeat:no-repeat;
    }
    
    #media a:hover{
      height:49px;
      width:85px;
      background-repeat:no-repeat;
    }
    
    #media > a{
      background-image : URL(images/menu/media_normal.png );
    } 
    
    #media > a:hover{
      background-image : URL(images/menu/media_selected.png );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I expected that manualy scheduled tasks will not change their dates automatically despite of
I have a fixed header. i want to change the opacity when i scroll
When we create an array, we cannot change its size; it's fixed. OK, seems
I'm trying to change the FontFamily of a ListBox to a fixed-width font, but
How do i change the size of the Windows Mobile 6 Emulator. Its fixed
I have a container whose size can change. I will by dynamically creating instances
Ok I have now virtually fixed our menu system. The only Issue I have
Is there are any way to change a fixed-width flat file connection manager to
Edit formatter action button is placed to jqgrid column: colModel: [{fixed:true,label: change ,name:_actions,width:($.browser.webkit ==
I want to use .animate to change colors when .bind('click') is fired, using jquery

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.