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.

HTML Forum


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



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
float right and float left, keeping stuff beneath it beneath :)
Old 07-22-2005, 01:55 PM float right and float left, keeping stuff beneath it beneath :)
lajkonik86's Avatar
Ultra Talker

Posts: 389
Trades: 0
I'm a bit new to table-less design
one problem in particular is bothering me.
If i want to have 2 columns somewhere on my page i use a float: left and a float:right
problem is that content beneath those 2 divs comes up and goes into the divs.

How do i stop that from happening?
__________________
Know what to Download

Please login or register to view this content. Registration is FREE
lajkonik86 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-22-2005, 02:30 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
insert a clearing div after the floats to break them.
HTML Code:
<div style="clear:both;"></div>
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is 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 07-22-2005, 02:33 PM
danburzo's Avatar
Skilled Talker

Posts: 82
Location: Bistrita RO
Trades: 0
for two column you don't need to float both divs. Let's say you have a left sidebar of 200px and a main content.
your code would be:
Code:
<div id="page">
   <div id="sidebar">My left sidebar</div>
   <div id="content">My main content</div>
</div>
and the css:

Code:
#sidebar {
   width: 200px;
   float:left;
}

#content {
   margin-left: 200px;
}
the margin-left is to prevent the content div to wrap around the sidebar if it expands beyond the height of the sidebar... i hope you understand. I'm not really good at explaining stuff.
danburzo is offline
Reply With Quote
View Public Profile
 
Old 07-22-2005, 06:03 PM
lajkonik86's Avatar
Ultra Talker

Posts: 389
Trades: 0
the margin is calculated from the container above these 2?
clear:both sounds nice aswell


ps. anyway to get rid of using
-moz-box-sizing: border-box;
in everything which has padding?
__________________
Know what to Download

Please login or register to view this content. Registration is FREE
lajkonik86 is offline
Reply With Quote
View Public Profile
 
Old 07-23-2005, 06:21 AM
lajkonik86's Avatar
Ultra Talker

Posts: 389
Trades: 0
in your example if content has less height then sidebar wouldn't anything beneath the content wrap beneath the sidebar?
__________________
Know what to Download

Please login or register to view this content. Registration is FREE
lajkonik86 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to float right and float left, keeping stuff beneath it beneath :)
 

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.14761 seconds with 12 queries