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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:54:25+00:00 2026-06-11T16:54:25+00:00

I am using: <div class=class1>Image</div> <div class=class2>Image</div> <div class=class3>Image</div> <div class=class4>Image</div> I am using

  • 0

I am using:

 <div class="class1">Image</div>
 <div class="class2">Image</div>
 <div class="class3">Image</div>
 <div class="class4">Image</div>

I am using images as background which should all be in the same line (all images).
I am using float:left in which two images will be float:right.
But my problem starts when the browser is resizing. All the images will be disordered in different lines.

Any help is appreaciated.

  • 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-11T16:54:26+00:00Added an answer on June 11, 2026 at 4:54 pm

    Your question is unclear.

    If you are wanting all four divs (and why are you using a div instead of an <img>?) to stay in a row, and not wrap onto the line below if the browser window is too small, then you could try (assuming an image width of 200px – using a style instead of a class for simplicity – this is not suitable for deployment!):

    <div style="width:800px">
      <div class="class1">Image</div>
      <div class="class2">Image</div>
      <div class="class3">Image</div>
      <div class="class4">Image</div>
    </div>
    

    This will force the container div to be wide enough to contain all four images in a row. However, if the browser isn’t wide enough to show them, you will get a horizontal scroll bar (which is not good from a User Experience point of view)

    Alternatively, use your current HTML, and just float all of them left. If the browser window is resized, then the last image will drop onto the next row, and the divs should remain in the same order

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

Sidebar

Related Questions

I need to set the image height everytime I'm using background: url('images/something.jpg')[..]; Fe. HTML:
i'm making a splash image div that changes the background with different css class,
I can select the first item in the div using $('.class:first') Now since I
i am creating div using DOM Element as phototab = document.createElement('div'); phototab.setAttribute('class', 'phototab fleft');
Using jQuery in IE8, I'm creating a div with a class (ex. <div class=className></div>
So I'm aware of how to select a node using htmlagilitypack: HtmlNode.SelectNodes(.//div[@class='description']) etc... but
I'm using a div based layout and GWT which LOVES to use tables everywhere.
I am using WAMP. I want to take background image URL from my database
I am using Jquery to add a class to a div like so... somediv.addClass('correct').removeClass('wrong');
Say I have several inline-block div tags, like this <div class=image> </div> <div class=image>

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.