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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:41:11+00:00 2026-06-09T06:41:11+00:00

Suppose you have a container (div) and a bunch of nested inline-block or floated

  • 0

Suppose you have a container (div) and a bunch of nested inline-block or floated divs.
http://jsfiddle.net/D6PgE/

.container { width : 300px; }
.inner     { width : 100px; }

<div class="container">
    <div class="inner"> 1 </div>
    <div class="inner"> 2 </div>
    <div class="inner"> 3 </div>
    <div class="inner"> 4 </div>
    <div class="inner"> 5 </div>
    <div class="inner"> 6 </div>
    <div class="inner"> 7 </div>
    <div class="inner"> 8 </div>
    <div class="inner"> 9 </div>
</div>

What is the best way to select elements that have been wrapped? Is it possible to select the nth element of a wrapped row (in the fiddle it would be the odd numbers).

The only thing I can think of is to use JS and compare the offsetTop position of the elements; however I haven’t kept up with CSS lately and know that its becoming ever more powerful, so is there a CSS solution? -thanks


Edit
I am trying to select the nth-element of a “row”. The issue is that there are no rows as this is not a table. I should also add that my example was simple because the widths may very, so there may be more or elements per line – therefore something like nth-child will not work

  • 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-09T06:41:19+00:00Added an answer on June 9, 2026 at 6:41 am

    No, there is no CSS solution that will work with unknown/dynamic sizes, as selectors cannot select based on how elements are being laid out or how their styles are computed.

    You will need to use JS to obtain and work with that kind of information.

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

Sidebar

Related Questions

Suppose I have the following HTML code: <div id=container style=width: 960px> <div id=help_panel style=width:
suppose I have a simple container which have three element: <div> <span>hello world</span> <input
I have a container div (it has both width an height set in pixels).
Suppose I have the following HTML: <div class=container> <span class=remove>remove</span> </div> and jquery: $(.container).delegate(.remove,
Suppose I have an outer container of unknown fixed width, and an inner element,
I have a header inside a container div with a width of 960px. The
Suppose I have a page with the following content: <div><p>Some content</p></div> <div id=container><p class=destroy>Some
Let's suppose there are many divs inside a div: <div id=#container> div div div
Suppose I have the following DOM : <div id=container> <div id=created-by-other-tools>I want this to
Suppose I have a div named container as shown <div id='container'>50</div> Now if I

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.