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 6720641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:14:11+00:00 2026-05-26T09:14:11+00:00

Consider my html as follows: <ul id=menu> <a href=home.html><li class=highlighted id=first_item>Home</li></a> <a href=join.html><li class=non_selected_tabs>Join</li></a>

  • 0

Consider my html as follows:

<ul id="menu">
<a href="home.html"><li class="highlighted" id="first_item">Home</li></a>
<a href="join.html"><li class="non_selected_tabs">Join</li></a>
<a href="fixtures.html"><li class="non_selected_tabs">Fixtures</li></a>
<a href="club.html"><li class="non_selected_tabs">Our Club</li></a>
<a href="history.html"><li class="non_selected_tabs">History</li></a>
<a href="club_gear.html"><li id="hover" class="non_selected_tabs">Club Gear</li></a>
</li>
</ul>

My lists are styled as tabs, and I have my anchors as their parents so that when a user hovers over a tab it becomes selectable

My issue is that I was hoping to use a:hover, or the other anchor properties to change the background colour of my list item…is this possible using CSS?
I can’t get it to work so I’m thinking I may have to use some JavsScript?

  • 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-26T09:14:11+00:00Added an answer on May 26, 2026 at 9:14 am

    Wrapping the <li>‘s in <a> is improper HTML and may not render properly in all browsers. A better solution would be to set the display property of the anchor to display:inline-block. Then you will be able to set the width and height of the anchor to the width and height of the li’s. This way you can also use the hover property of the anchors.

    <ul id="menu">
     <li class="highlighted" id="first_item"><a  href="home.html">Home</a></li>
    <li class="non_selected_tabs"><a href="join.html">Join</a></li>
    <li class="non_selected_tabs"><a href="fixtures.html">Fixtures</a></li>
    <li class="non_selected_tabs"><a href="club.html">Our Club</a></li>
    <li class="non_selected_tabs"><a href="history.html">History</a></li>
    <li id="hover" class="non_selected_tabs"><a href="club_gear.html">Club Gear</a></li>
    
    </ul>
    
    #menu li a
    {
       display: inline-block;
       width: 100%;
       height: 100%;
    }
    #menu li a:hover
    {
      background-color:red;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following html: <div id=rightBar> <div class=barElement> <div class=barText><a href=#>Not underlined</a><br /></div> <div
Consider my HTML <div class=abu> <div id=pfabricsmenu1 class=box_conti_homepage> <h2 class=tel_title><a rel=dropmenu1 href=/new_site/?page_id=127>Telecommunications</a><br /> <img
Consider the following HTML: <div class=foo id=obj> I should be changed red <div class=bar
Consider the following markup: <!DOCTYPE html> <html> <head> <title>Test Page</title> <link href=screen.css rel=stylesheet />
Consider this code : HTML: <div class='a'>a</div> <div class='b'>b</div> <div id='log'></div> CSS: .a, .b
Consider the following HTML : <a id=add herf=#>add</a> <div class=list> <select> <option>1</option> <option>2</option> </select>
Consider the following code : HTML: <div id='button' class='enabled'>Press here</div> <div id='log'></div> CSS: #button
Consider the following HTML structure: <div class=content> <div class=field field-type-date field-field-event-date> <div class=field-items> <div
Here's my problem: Consider the following html: <div id=item1 class=green_large> <div id=item2 class=green_large> <div
Consider the following HTML: <div id=myfavorites> <p><button id=saveFav>Save my favorites</button> </p> <p><a href=http://bit.ly/fzgxya>http://bit.ly/fzgxya</a> <a

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.