CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 23rd, 2004, 05:14 AM
xtomxfallsx xtomxfallsx is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 6 xtomxfallsx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 5 m 29 sec
Reputation Power: 0
Negative margins and floating divs

I'm redoing the layout of my site (www.brohawk.com) using floating divs with negative margins to produce a fluid left column and a fixed right column. I followed an article on A List Apart for the basics and got it working fairly nicely.

As a matter of fact, the site works beautifull in Mozilla/Firefox and with minmal errors in NS7. I've even got all but the forums working in Opera. I haven't even begun to work on making it IE compliant. Saving the worst for last.

Anyhow, on all the pages except the forums, the divs line up perfectly. However, on the forums page, the right div doesn't stay up top, instead it wraps around under the left div. However, I still get all the space to the right of the left div where the right one should go.

Anybody with Opera should be able to check it out and see what I mean.

Anyhow, can anybody tell me why it won't float properly on that one page, but it works on all the others?

Reply With Quote
  #2  
Old July 23rd, 2004, 09:51 AM
kk5st's Avatar
kk5st kk5st is offline
Thanks Johnny Hart (BC) R.I.P.
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: May 2003
Location: Dallas
Posts: 4,659 kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 11 h 50 m 18 sec
Reputation Power: 687
Assuming you want a fixed width (180px) right column, and you want the forum column to occupy the rest of the viewport, try this as a basic layout;
Code:
—Styles—

#menucolumn {
    float: right;
    width: 180px;
    margin-right: 2px;
    border: thin solid #333;
    background-color: #eee;
    display: inline;  /*IE hack for doubled margin.  This bug only occurs when the float
                       margin goes in the same direction as the float and is trapped directly
                       between the float and the inside edge of the container box. Hey, it's
                       an IE thing.*/
    }

#maincolumn {
    margin: 0 186px 0 2px;
    border: thin solid #333;
    }

—HTML—

<div id="menucolumn">
  <!-- menu stuff -->
</div> <!--end menucolumn -->

<div id="maincolumn">
  <!-- forum tables go here -->
</div> <!-- end maincolumn -->

cheers,

gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing.

My html and css workshop, demos and tutorials.
Ask a better question, get a better answer.

Reply With Quote
  #3  
Old July 23rd, 2004, 02:05 PM
xtomxfallsx xtomxfallsx is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 6 xtomxfallsx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 5 m 29 sec
Reputation Power: 0
Thanks a ton! I had to make a few layout changes to accomodate, but that worked great.

Now if only I could get the damn site to work in IE.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Negative margins and floating divs


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT