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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:58:38+00:00 2026-06-13T17:58:38+00:00

There are two <div> elements, each with the same class. It is easy to

  • 0

There are two <div> elements, each with the same class. It is easy to make them into a two-column layout: http://jsfiddle.net/Baumr/nbzHA/3/

So here’s the catch:

How do you add a whitespace between them?

It would be easy to make two separate classes, and float them either way.
Or add a class to one and use margins: http://jsfiddle.net/Baumr/sZehH/1/

But what if they’re in the same class/no class?

  • 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-13T17:58:39+00:00Added an answer on June 13, 2026 at 5:58 pm

    Adding a class on the first div is the best browser compatibility solution, then add your style for this class.

    There are things I noticed with your fiddle which make it complex to have solution based on your comments to niels. You have a section tag in your fiddle which will render in a browser supporting an html5. But you want to have a compatibility with IE7 and IE6?

    There are ways for IE7, below is one of those:

    .section div+div {
        margin-left: 10%;
    }
    

    This solution use the Adjacent sibling selectors which added a margin-left on the second div. And also, instead of section tag I use a <>div with class=section for the benefits of browser that don’t support section.

    For IE6, adding a class on one of the two <>div is the only solution I know.

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

Sidebar

Related Questions

I have these div blocks called columns where each column div contains separate two
Two questions about this fiddle. http://jsfiddle.net/mjmitche/4emqh/2/ 1) Originally, the black box (with div id
I have a layout with two main divs. The width of each div is
I'm trying to display two <div> elements on the same line, but in the
In each div, there are two buttons: higher and lower. When 'higher' is clicked,
Here's my dilemma - I have a two-column list of elements (styled <div> s)
I have two HTML div elements, one source one destiny; inside of each one
I have created a div there are two childs of that div one is
Is there a way to overlay/overlap two or more images using one div only?
trying to take this content: <div class=content>one,two,three</div> <div class=content>four,five,six</div> <div class=content>seven,eight,nine</div> and .split and

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.