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

  • Home
  • SEARCH
  • 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 9141075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:35:56+00:00 2026-06-17T09:35:56+00:00

Here are html codes: <div class=wrapper> <div class=menu-wrap> <ul> <li> <input type=radio id=link1 />

  • 0

Here are html codes:

<div class="wrapper">
  <div class="menu-wrap">
    <ul>
     <li>
       <input type="radio" id="link1" />
     </li>
    </ul>
  </div>

  <div class="content-wrap">
    <div id="link1-content"><p>Just a paragraph</p></div>
  </div>
</div>

Here are css codes:

#link1:checked ~ #link1-content { display: none;}

I am trying to create css click with input[type=radio]. My problem is that the sibling selector does not work.

How can I write appropriate sibling selector?

  • 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-17T09:35:57+00:00Added an answer on June 17, 2026 at 9:35 am

    You are trying to do something sibling selectors cannot do. You will not be able to style #link1-content because it does not share the same parent as #link1:checked.
    As @sirko said, this is something that should be accomplished with Javascript/JQuery (see my snippet below).

    Source
    Child and Sibling selectors — CSS Tricks

    Note that in both the general sibling and adjacent sibling selectors the logic takes place within the same parent element.

    A very simple jQuery solution:

    $('#link1').change(function(){
      $('#link1-content').toggle();
    });
    

    Codepen example

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

Sidebar

Related Questions

Here is the code I am having: <div id=removequestions></div> var html += '<input type=radio
first here is my html demo code <div class=wrapper> <div class=item></div> <div class=item></div> <div
Given the following HTML structure: <div class=wrapper> <div class=top> <a href=http://example.com class=link>click here</a> </div>
Here is the html <div id = wrapper class = selfclear> <div id =
I have the following HTML: <div id=wrapper> <div class=p1> <a href=# class=quickFlipCta><img src=Test Pictures/QuestionMark.gif
Here is the DEMO HTML CODE as <div id=me></div> <a id=ok href=>OK</a> jquery code:
I want to make some design tweaks. Here is the code for html: <div
Here's my code: // Open modal window with links $('.links').colorbox({speed:100, opacity:0.75, html:'<div id=links-colorbox><h2>Download links</h2><textarea
i just want to ask about my html code here, i have a bit
I want to display html code just like what your see here. <textarea><script id=ff>gdgdgs</script></textarea>

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.