Solved

CSS Float & Display Issue

Posted on 2006-07-06
5
225 Views
Last Modified: 2012-05-05
I have thumbnails set up in a div box "smBox":

.smBox {
                  text-align: center;
                  margin-bottom: 5px;
                  margin-left: 0px;
                  margin-right: 5px;
                  margin-top: 0px;
                  width: 135px;
                  height: 170px;
                  float: left;
                  background-color:#999999;
            }

<div class="smBox">
      <div class="product1Box">
            <a href="productview.asp?ProdNUM=3905-0150"><img src="productImages/3905-0150.jpg" border="0" alt="Vertical All-Metal ID Badge Rack 3905-0150" /></a>
      </div>
      <a class="thumbText" href="productview.asp?ProdNUM=3905-0150">Vertical All-Metal ID Badge Rack<br /><!--*#-->3905-0150<!--/#--></a>
</div>

They float left so that the contents flows and fills up the browser window (width allowing), even as the window is resized.

The problem is that any text that comes after this box is not starting below the box. You might think "well that's supposed to happen, its floating." no its not. I have all of my thumbs encased by another div... which is supposed to be a block element. I dont understand why the text  appears to the right of the last box rather than beneath it.

<div>
     <div class="smBox">Content</div>
     <div class="smBox">Content</div>
     <div class="smBox">Content</div>
     <div class="smBox">Content</div>
     <div class="smBox">Content</div>
     <div class="smBox">Content</div>
</div>
Text that is supposed appear below thumbnails.

I have tried assiging the containing div a display: table-row. It seems to work in firefox( but I can't shake the feeling its the wrong syntax/usage). When I check it in IE, it seems IE has Issues with display: table-row. Even if I put another div inside with display:table-cell.

Help?
0
Comment
Question by:cipiWeb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 30

Accepted Solution

by:
GrandSchtroumpf earned 350 total points
ID: 17054462
use the "clear" property:

<div style="clear:left">Text that is supposed appear below thumbnails.</div>
0
 

Author Comment

by:cipiWeb
ID: 17057721
Thank You, I'll try testing that out.

What does the clear property do? I like to understand how what I am using works.
0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 17057788
Here is a CSS reference guide:  http://www.htmlhelp.com/reference/css/box/clear.html
0
 

Author Comment

by:cipiWeb
ID: 17059026
Thank you very much. It works Perfectly.
0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 17060778
:)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CSS SASS 4 55
change site header 8 31
drop down menu blocks search boxes 4 22
CSS - display the same fonts throughout website. 4 25
This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question