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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:29:47+00:00 2026-06-06T13:29:47+00:00

I’m building my website using only html and css. I’ve read several tutorials and

  • 0

I’m building my website using only html and css. I’ve read several tutorials and did my research, but now I’m stuck in an area. I have created a menu on top of my page using ul and li and within the li are the links. the links themselves hold more info other than just the link. There is a span after them, and the span shows info that I will show after the user clicks on the link. I use a:focus for the info to show on the page. So the structure is:

<ul>
    <li><a href="#" tabindex="1">RESUME
        <span class="resume">
            blah blah blah
        </span></a>
    </li>
    <li><a href="#" tabindex="1">My artwork
        <span class="artwork_area">
            blah blah blah
        </span></a>
    </li>
</ul>

While it’s fine that the resume section works well with a:focus, and getting it to display on the page only after the user clicks on it, it will not work the same with ‘my artwork’ because I need to have more links inside that section. I know that it’s not allowed to have links nested inside other links, so how can I get the code to look like this?

<ul>
    <li><a href="#" tabindex="1">RESUME
        <span class="resume">blah blah blah</span>
        </a>
    </li>
    <li><a href="#" tabindex="1">My artwork</a><!--notice how the link ends here-->
        <span class="artwork_area">
            <p>blah blah blah
            <a href="assets/images/image1.jpg"><img src="assets/images/large_image1.jpg"/>Pic1</a>
            <a href="assets/images/image2.jpg" ><img src="assets/images/large_image1.jpg"/>Pic2</a>
            </p>
        </span>
    </li>
</ul>

This is where I’m stuck. I can’t figure out how to make that span section appear without nesting it inside the link, but that won’t be acceptable to nest another link within it.
I’ve only been reading and putting to practice html and css for about 3 weeks, so I’m not that savvy yet. I would really like to do my website in only html and css as I see it is more convenient and loads much faster. I made a short youtube video to explain how it currently looks.

  • 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-06-06T13:29:50+00:00Added an answer on June 6, 2026 at 1:29 pm

    Short Answer

    I had a quick look on the w3schools css selector reference and noted the element+element selector with example:

    div+p -> Selects all <p> elements that are placed immediately after <div> elements
    

    So I tried the following style and it works for your second example

    a:focus+span {
       display:block;
    }
    

    And The Rest Of It

    I’ve made an assumption on what your css looks like – perhaps you could edit your question to show this so that your example is complete.

    But based on the html example you provided the following works for both cases.

    <style>
    li>span {
        display:none;
    }
    
    li>a:focus span {
        display:block;
    }
    
    li>a:focus+span {
        display:block;
    }
    </style>
    

    Thinking about it if you were to make things consistent so that you never nested the span inside the action link, you could remove the a:focus span selector. Your resume list-item would become:

    <li>
        <a href="#" tabindex="1">RESUME</a>
        <span class="resume">blah blah blah</span>
    </li>
    

    Also if you haven’t already done so you might want to give the list-item elements of your menu system a common class eg menu-item so as to constrain css further. Here the intent is to always show the last list-item Outside.

    <style>
    li.menu-item>span {
        display:none;
    }
    
    li.menu-item>a:focus+span {
        display:block;
    }
    </style>
    
    ...
    
    <ul>
        <li class="menu-item">
            ... Resume 
        </li>
        <li class="menu-item">
            ... My artwork
        </li>
    </ul>
    
    <ul>
        <li>
            <a href="#" tabindex="1">Outside</a>
            <span class="resume">outside stuff which is always shown</span>
        </li>
    </ul>
    

    One final thing; I noticed that clicking on one of the image action links breaks the whole thing since the main action link is hidden again. From what I can see there’s no parent-from-child selector so I’m not sure at this stage how this will work for you. Anyways I think the element+element selector answers your specific question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I have thousands of HTML files to process using Groovy/Java and I need to
I am using parse_ini_file to read the contents of a file however it is
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,

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.