Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Problem with lining up divs with float command
Old 12-02-2007, 08:22 PM Problem with lining up divs with float command
Average Talker

Posts: 20
Trades: 0
Hey guys. Im utterly lost. I'm new to coding and have pretty much finished my first site! I'm a fast learner I guess, but I cannot figure out one problem. I have a div box and inside that div box I have set up three div classes and used the float:right; command to get them to line up with one another.. as soon as I use the float command it kicks the div class items out of the main div box.. but as soon as i remove the float command it puts them back in the div box.. images and code below.. in the images ignore the text.. i took that out and it still does the same thing.

with the float command set to (float:right


http://img337.imageshack.us/my.php?image=pic1cd8.jpg

with the float command set off

http://img248.imageshack.us/my.php?image=pic2an5.jpg

css

Code:
.thumbnail {
float:right;
width: 160px;
border: 2px solid #ddd;
margin: 15px;
padding-top: 10px;
padding-left: 10px;
background-color: #fff;
}

#containerbox2 {
    margin: 10px;
    padding: 5px;
    border: 1px solid #999;
    background-color: #eee;
    }
HTML
Code:
<div id="bottom">
        <div id="containerbox2">
        
        <h1>featured <strong><em>samples</em></strong></h1>
          <h2>our best work</h2>
          
    <div id="thumbnail">
            <img src="http://www.webmaster-talk.com/images/blank150.jpg" alt="#" width="150" height="150">
            Kirby Litho
          <em>SelfPromotion Xmas</em>          </div>    
        <div id="thumbnail">
            <img src="http://www.webmaster-talk.com/images/blank150.jpg" alt="#" width="150" height="150">
            Kirby Litho
          <em>Directory2007</em>          </div>
        
        <div id="thumbnail">
            <img src="http://www.webmaster-talk.com/images/blank150.jpg" href="#" alt="#" width="150" height="150">
            Kirby Litho
          <em>HardCover Manual          </em></div>
      </div>             
            </div>

Last edited by slickwilly789; 12-02-2007 at 08:27 PM..
slickwilly789 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-02-2007, 08:59 PM Re: Problem with lining up divs with float command
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Do we take it that the "problem" is with Internet Exploder?

floating an element takes them out of the normal flow. The floats then have to be cleared to return to the flow.

add a "clearing" element after the floated elements to correct it.

<br style="clear:both;"> for example
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-02-2007, 09:01 PM Re: Problem with lining up divs with float command
Average Talker

Posts: 20
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Do we take it that the "problem" is with Internet Exploder?

floating an element takes them out of the normal flow. The floats then have to be cleared to return to the flow.

add a "clearing" element after the floated elements to correct it.

<br style="clear:both;"> for example
its happening in IE and firefox.. also shows up in the dreamweaver design view
slickwilly789 is offline
Reply With Quote
View Public Profile
 
Old 12-02-2007, 09:03 PM Re: Problem with lining up divs with float command
Average Talker

Posts: 20
Trades: 0
omg it worked! im such a noob.. been trying to teach myself so its hard to learn... thanks so much
slickwilly789 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Problem with lining up divs with float command
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16225 seconds with 12 queries