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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:49:20+00:00 2026-05-13T11:49:20+00:00

I know this is a srs beginner question, but here goes: I am trying

  • 0

I know this is a srs beginner question, but here goes:

I am trying to get a box, with an icon in the top left corner, and all the content of that box will be to the right of the icon.

This is the code I am using:

<div class="statsbox float_left">
    <img src="images/chart_bar.png" class="float_left"> 
    <div class="float_left">
        <p class="statsbox_header"> User Uploaded Images </p>
        <ul class="statsbox">
            <li class="statsbox"> 122 uploaded images </li>
            <li class="statsbox"> 13 images pending approval </li>
            <li class="statsbox"> 15 anonymous images </li>
            <li class="statsbox"> 97 unique users </li>
        </ul>
    </div>
    <div class="clear"></div>
</div>
<div class="clear"></div>

it seems like it should work, but it turns into this:

it fails
(source: theviolencestopshere.ca)

the <div> tags are outlined.
You can see that the <div> containing the list overlaps the image for some reason.

Note: if the unordered list isn’t in that div, then this works as expected. It’s like the presence of bullets push it over further to the left.

Also note: this still doesn’t work if I wrap the <img> in it’s own div.

What am I doing wrong here? The float_left class is predictably just float: left, clear is just clear: both, and the other classes are not defined yet, in case that is relevant.

  • 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-13T11:49:21+00:00Added an answer on May 13, 2026 at 11:49 am

    Could I offer an alternative? I think both your markup and your css are unnecessarily verbose. This is a slightly rough example, but hopefully is enough to illustrate my point:

    <style type="text/css">
        .statsbox {
            background: transparent url(path_to_image) no-repeat 9px 20px;
            float: left;
            width: 300px;
        }
    
        #stats h3 {
        }
    
        #stats {
            padding-left: 40px;
        }
    
        #stats ul {
            padding-left: 1em;
        }
    
    </style>
    
    <div class="statsbox">
        <div id="stats">
            <h3> User Uploaded Images </h3>
            <ul>
               <li> 122 uploaded images </li>
               <li> 13 images pending approval </li>
               <li> 15 anonymous images </li>
               <li> 97 unique users </li>
            </ul>
        </div>
    </div>
    

    The key things I’m doing here are:

    1. Removing the img element and applying it as a background image of .statsbox instead. This actually gives you lots of flexibility about where the image goes, without it impacting on the other elements in the html.

    2. Avoiding using list-style-postition: inside – using this property means the bullets are basically rendered as a part of the text line they are on; if the lines happen to wrap for any reason, the bullets will fail to line up properly.

    3. Made <p class="statsbox_header"> User Uploaded Images </p> an h3 instead. You’ve indicated that it’s a heading so you might as well use that element, as it leads to cleaner markup/css.

    4. Removed the class “statsbox” from the <li> elements as CSS inheritance means you should be able to style these just by using a selector such as .statsbox li or similar. Which again makes your markup and styles simpler.

    Sorry, I’m a bit rushed for time ATM, but if you need me to expand upon this answer, then please just ask 🙂

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

Sidebar

Related Questions

I know this is a noobish question, but I cannot get android-xmlrpc properly hooked
I know this is a pretty specific question but I managed to get some
I know this is a daft question but I have a select box with
I know this isn't strictly a programming question but y'all must have experienced this.
I know this is a broad question, but I've inherited several poor performers and
I know this rather goes against the idea of enums, but is it possible
Know this might be rather basic, but I been trying to figure out how
I know this is a stupid question, but I can't find the answer anywhere.
I know this question has been asked and answered in several ways, but none
I know this question must have been covered endless of times, but I've searched

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.