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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T20:59:56+00:00 2026-06-18T20:59:56+00:00

Working on simply floating text around an image, but it’s not going well in

  • 0

Working on simply floating text around an image, but it’s not going well in IE7. The text is pushed below the image, as if no float.

From what I’ve read, the reason for this could be that the image and text are within a floated (and fixed width/height) div, which presumably triggers “hasLayout” for the containing div. I’ve been looking for a clean workaround, but none has yet been found.

In worst case I guess I can use jQuery, as I am already using that on the page, but I would prefer to solve this with CSS.

Here is a fiddle, works well in good browsers, but should fail in IE7.

Good (Firefox, Safari, Chrome, Opera, IE8+):

Good image

Bad (IE7):

Bad image

HTML:

<html>
<body>
    <div id="box_section">
        <div id="container1">
            <div id="container2">
                <div class="box">
                    <img src="http://c69282.r82.cf3.rackcdn.com/robot.jpg"/>
                    <p>Lorem ipsum etc etc whatever.</p>
                </div>

                <div class="box">
                    <img src="http://c69282.r82.cf3.rackcdn.com/pushing278.jpg"/>
                    <p>Lorem ipsum etc etc whatever.</p>
                </div>                    
            </div>
        </div>
    </div>
</body>
</html>

CSS:

/* Container for floating boxes */
#box_section
{
    height: 300px;  /* Fixed height and width */
    width: 984px;
    margin-top: 35px;  
    padding: 0;
    overflow: hidden;  
    margin-left: auto;
    margin-right: auto;    
}

/* Containers used to centre floated items independent of number */
/* In real webpage there can be any number of boxes. */
#container1
{
  padding: 0;
  float:left;
  width:100%;
  overflow:hidden;
  position:relative;
}

#container2
{
  clear:left;
  float:left;
  padding:0;
  position:relative;
  left:50%; 
}

/* The box. OMG. */
.box
{  
  float: left;  
  position:relative;
  right:50%;
  height: 190px;            /* Note fixed height and width */
  width: 350px;
  border-style: solid;  
  border-color: #ebead4; 
  border-width: 1px;
  padding-top: 10px;
  padding-left: 10px;
  padding-right: 10px;
  margin: 20px;  
  overflow: hidden;  
}

/* Goal is to float text around image. Note that images have fixed width/height.
Images snatched from random website for demonstration purposes. */
.box img
{
  float: left;
  margin-right: 15px;
  height: 180px;
  width: 200px;
  border-style: solid;
  border-radius: 5px;
  border-color: #eeeeff; 
  border-width: 1px;
}

Note that the solution for the containing div must be quite flexible, as there can be any number of these boxes and they have to be floated in the center (jQuery is used to only display one row at a time). The boxes can also be any one of 4 different fixed widths.

Also this is further complicated by the fact that the image can be one of 2 widths (2 different CSS classes), or not be there at all. I thought about making the image position absolute and do it with margins, but that therefore fails.

  • 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-18T20:59:57+00:00Added an answer on June 18, 2026 at 8:59 pm

    Aw scrap it. My mistake.

    Turns out the fiddle works fine in IE7, and the problem was that I had a global css rule for “header” elements which set min-width. I used header elements in my boxes… Feeling very smart now.

    Thanks to all of you who tried to help.

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

Sidebar

Related Questions

I'm working on a simply password strength checker and i can not success applying
When I simply print the query I get: one=1&two=2&three=3&four=3&five=3&six=3 Still not working!!!! I am
The following jQuery is not working as expected. I'm simply trying to fire an
Full disclosure: this is for an assignment. Simply getting working code is enough, but
So, this is simply not working. CheckBox chck_bluetooth = (CheckBox) findViewById(R.id.chck_bluetooth); if (mProperties.getProperty(bluetooth) ==
So, I have a CRON job that is simply not working. For a while
For some reason the script below is not working. This is the code I
I'm working on a simply syntax highlighter that replaces text with dom elements with
Simple rounding of a floating point numpy array seems not working for some reason..
I'm trying to layout a simple three-column header, but something's not working quite right.

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.