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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:56:03+00:00 2026-05-24T15:56:03+00:00

I currently have a problem concerning the behaviour of floating items, and containers not

  • 0

I currently have a problem concerning the behaviour of floating items, and containers not wrapping around them.

I have a list of items that wrap floating elements. This is a very simplified version:

<ul class="items">
  <li><img src="" />Text here</li>
  <li><img src="" />More text</li>
</ul>

The CSS looks something like this:

ul.items li
{
  display: block;
  border: 1px solid pink;
}

ul.items li img
{
  float: left;
}

Previously I have added a ‘clearing’ item at the bottom of each list item to expand it to wrap around the image. This is equivalent to Tony Aslett’s CSS version. An example can be seen here.

Unfortunately, I have a menu floating on the left of the list, meaning that adding the clearing creates a huge space underneath the first item. This is mentioned on the above page under A Word Of Warning (this is important). The effect can be seen here.

I followed an alternative solution I found from Paul O’Brien, using the overflow property. This works like a charm. Unfortunately, in addition to the menu on the left, each list item had a menu floating in the upper-right. With overflow: auto, those items are pushed outside. This can be seen here. The markup is similar to this:

<ul class="items">
    <li>
        <div class="floaty">*</div>
        <div class="item">
            <div class="img"></div>Text here
        </div>
    </li>
    <li>
        <div class="floaty">*</div>
        <div class="item">
            <div class="img"></div>More text
        </div>
    </li>
</ul>

Is there any way to get the ‘floaty’ element to stay inside the ‘item’ element using this method? Alternatively, is there another solution I might be missing?

  • 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-24T15:56:03+00:00Added an answer on May 24, 2026 at 3:56 pm

    I’m not 100% sure what the entire use-case is here, but for the .floaty element is it reasonable to use position instead of float?

    Basically add this:

    ul.items li { position: relative; }
    div.floaty { float: none; position: absolute; top: 0; right: 0; }
    

    Fiddle

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

Sidebar

Related Questions

I have a problem that output string must be utf8-formatted, I am writing currently
I am currently facing a problem that is concerning the google search, curl and
i am currently working on a facebook game and i have a problem concerning
I currently have a problem with my jgroups configuration, causing thousands of messages getting
I currently have a problem attepting to update a record within my database. I
I am new to Rails routing and I currently have a problem and hope
I have the following problem using subversion: I'm currently working on the trunk of
I have the following problem: I have a form in site/banen (currently local running
Currently developing a PHP framework and have ran into my first problem. I need
I am currently trying to learn C and I have come to a problem

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.