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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:21:57+00:00 2026-06-10T14:21:57+00:00

I have some markup like this: <div class=field> <div class=selector id=uniform-blablabla> [select tag markup]

  • 0

I have some markup like this:

<div class="field">
    <div class="selector" id="uniform-blablabla">
        [select tag markup]
    </div>
<div>
<div class="field">
    <input type="text" id="etcetc"
</div>

I’m looking for a css selector that will select the input tag above based on the fact that its containing .field div is preceded by a .field div containing a div with a .selector class, as in the markup above. I’ve tried

div.field > .selector + div.field > input

but that doesn’t work, I assume because the input tag isn’t a sibling of the div tag with the .selector class and I really need their parents to be siblings.

I’ve read up on some of the interesting reasons that CSS doesn’t support any sort of “parent” selector, and I can see why. I’m wondering if there’s another way to accomplish this, short of putting a class on each input tag that follows a selector. Is there?

  • 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-10T14:21:59+00:00Added an answer on June 10, 2026 at 2:21 pm

    I’m wondering if there’s another way to accomplish this, short of putting a class on each input tag that follows a selector. Is there?

    Not with a CSS selector. You will have to add an extra class based on the preceding sibling div having div.selector as a child.

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

Sidebar

Related Questions

I have got some markup that looks like this: <div class=button> <span class=image></span> <input
I have some markup kind of like this <div class=background> <ul> <li class=tab>tab</li> <li
I have a html markup with some <div> elements like this: <div id=1 class=classic>i
I have a string contaning some html markup, like this: var html = <div>
I have some markup like so: <div class=list> <article> content... </article> <article> content... </article>
I have some markup like so: <li> <span> <div> <a href=# class=anchor menu-active>Afghanistan</a> <div
I have some markup, like so... <div id=items> <div class=item></div> <div class=item></div> <div class=item></div>
I have this markup: <div id=container> <h1>Heading</h1> <p>Some text</p> <div class=foo>Some stuff</div> <div class=foo>Some
I have this markup: <body> <div class=prevBtn> <a> < </a> </div> <div id=player> some
I have some markup like this (classes are just for explication): <ol id=root class=sortable>

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.