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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:37:17+00:00 2026-06-18T16:37:17+00:00

This is my div container: #randomid { margin-right:40px; margin-bottom:35px; float:left; } And there are

  • 0

This is my div container:

#randomid { 
margin-right:40px;
margin-bottom:35px; 
float:left;
} 

And there are 12 elements inside (in 2 rows). And I need to remove the margin-right from the far right ones (every sixth).

So I got this pseudo selector:

#randomid:nth-child(6n+6) {
    margin-right: 0; 
}

How can I make this work in IE 8 without using javascript?

  • 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-18T16:37:19+00:00Added an answer on June 18, 2026 at 4:37 pm

    Instead of using such a complex CSS-selector, with the drawbacks of lacking support in older browsers, there are possible workarounds to look into. I’ve put together a small example of how you can achieve what I believe is the desired result, without using the selector.

    Below example will have six elements on each row, with a margin separating each element, but without a margin before the first element or after the last element on each row.

    Markup:

    <div class="foo">
        <div class="bar">A</div>
        <div class="bar">A</div>
        <div class="bar">A</div>
        <div class="bar">A</div>
        <div class="bar">A</div>
        <div class="bar">A</div>
        <div class="bar">A</div>
        <div class="bar">A</div>
        <div class="bar">A</div>
        <div class="bar">A</div>
        <div class="bar">A</div>
        <div class="bar">A</div>
        <div class="clear"></div>
    </div>
    

    CSS:

    .foo {
        background-color: #ccc;
        width: 180px;
        margin: 0 -10px;
    }
    
    .bar {
        background-color: #888;
        float: left;
        margin-left: 10px;
        width: 20px;
    }
    
    .clear {
        clear: both;
    }
    

    Live example

    It might not be exactly what you want, but it will at least work as a starting point for you to adapt and develop further.

    Update:

    There are better ways to clear the float, that could be used instead of an extra element as used in my example (I used it just for simplicity). If interested, here is an SO question on that.

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

Sidebar

Related Questions

I have something like this: <div class=top>top</div> <div class=container> <div class=left>left</div> <div class=right>right</div> </div>
I have this container div with two elements: <div id=container> <div id=right>Some, list, of,
i have inside the body main 'container' div and inside this 'container' div there
I have a container (div) with a background image. In this div there is
I want to have 3 divs aligned inside a container div, something like this:
Here is my setup: I have a comment container div. Inside this div, I
I have this container div whose width I would like to set according to
http://subzerostudio.com/temp/verticalscroller/temp.html I want this scroll to effect the div#container instead of the body,html but
This is a simplified and explained version of my code: var ptext=parr.find('div.ptext'); //Text Container
This is my code : HTML: <div id="container"> <div id="box"> Content </div> </div>​ CSS:

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.