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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:32:48+00:00 2026-05-24T12:32:48+00:00

I am new to CSS and I am trying to create something unusual. My

  • 0

I am new to CSS and I am trying to create something unusual.

My code:

<body>
<div style="background-color:#C1C1C1; height:100%;">
    <div style="background-color:#F0F0F0; width:100px; height:100px; display:block; ">div1
    </div>
    <div style="background-color:#F0F0F0; width:100px; height:100px; display:block; ">div2
    </div>
        <div style="background-color:#F0F0F0; width:100px; height:100px; display:block; ">div3
    </div>
        <div style="background-color:#F0F0F0; width:100px; height:100px; display:block; ">div4
    </div>
        <div style="background-color:#F0F0F0; width:100px; height:100px; display:block; ">div5
    </div>
        <div style="background-color:#F0F0F0; width:100px; height:100px; display:block; ">div6
    </div>
        <div style="background-color:#F0F0F0; width:100px; height:100px; display:block; ">div7
    </div>
</div>
</body>

let’s say screen is 250px height -> the main div height will be 250px too then.

Result:

div1
div2
div3
...

I know that setting float:left; will display them like

div1 div2 div3 div4 div5 ....

I would like to get:

div1 div3 div5 div7
div2 div4 div6

It’s like horizontal gallery.
Also, when there would be more divs, is it possible to make main div’s width variable and add an x-scrollbar?

This is supposed to work on Internet Explorer 7 and higher only. Also, JavaScript is an option.

Thanks in advance!

  • 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-24T12:32:48+00:00Added an answer on May 24, 2026 at 12:32 pm

    What you’re trying to achieve is quite easy with CSS3: http://jsfiddle.net/Ykkyg/

    That fiddle provides the standard CSS for it, and the engine-specific properties for Webkit (Safari, Chrome) and Gecko (Firefox).

    There’s a couple of problems with this approach though:

    • First, IE doesn’t support it.
    • Second, If that column set grows taller than the browser window, you’re going to force your user to scroll up and down to read just one continuous piece of text. This sucks.

    Without CSS3, you can achieve this effect by carefully sizing all elements a priori, but that doesn’t scale, and I’m afraid I know of no generic solution to the problem that doesn’t involve some non-trivial javascript.

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

Sidebar

Related Questions

So this is new, I'm trying to create clean CSS, here's my code example:
I'm new to CSS and I'm trying to read the code that comes with
I am trying create a new css for shaping my detailsview. But i couldn't
I am trying to create a new html component using javascript and CSS. The
I am trying to create new div element and then change it`s position with
I am trying out twitter bootstrap and am new to CSS/HTML. Here's my simple
I am new to Zkoss and i need to create completely new css theme
I'm trying to create a JQuery slider and I've hit a roadblock. I'm new
I am trying to create a .NET Regex to parse a CSS font declaration,
I'm trying to create a conditional overlay for firefox's new addon manager in minefield

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.