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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:07:17+00:00 2026-05-27T15:07:17+00:00

I will try to make my problem as clear as I can, so please

  • 0

I will try to make my problem as clear as I can, so please bear with me! 🙂

I have something like the following html. Please note that each div in #container can be repeated any number of time in my application. So it’s possible that div.a will not the there, or that I’ll have more than one.

<div id="container">
  <div class="a">1</div>
  <div class="b">2</div>
  <div class="b">3</div>
  <div class="b">4</div>
  <div class="b">5</div>
  <div class="c">6</div>
</div>

In the above html, I want a css selector for div #3 and #5. Using div.b + div.b affects all div.b except the first one of the streak. Using div.b:nth-child(even) is starting its count at div #1, so div #2 gets selected and I don’t need it to.

What I need is to be able to select all the even div.b in a streak, without being affected by whatever is before or after the streak. And I’d like to avoid using JavaScript. Any idea?

  • 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-27T15:07:18+00:00Added an answer on May 27, 2026 at 3:07 pm

    I’m adding this answer in case someone finds this question from a search engine.

    After many hours of research, there is no magical all css answer to this. Don’t waste as much time as I did on this, and go with the “odd” and “even” class in the markup. 🙂

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

Sidebar

Related Questions

I will try to make this as clear as I can, but if you
I will try to be as clear as possible because I can't get anybody
EDIT2 Looks like I can't read properly, disregard this post, I will try to
I'm fairly new to C# but I will try to make this quick! ;)
What will be the code when I try to make a combo box read
I will try to keep this as simple as possible. I have a rather
At the moment I am experiencing a very frustrating problem. I will try to
i don't know how to ask my doubt... i will try to make my
I'm trying to make a form that will take given text and direct you
I have an app (iPhone) with 2 Xibs that I would like to localize,

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.