[SOLVED] Dropped Float

This is a discussion on "[SOLVED] Dropped Float" within the Starting Out section. This forum, and the thread "[SOLVED] Dropped Float are both part of the Design Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Starting Out

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Nov 26th, 2007, 00:38
Junior Member
Join Date: Aug 2007
Location: Markham, Ontario
Age: 55
Posts: 33
Thanks: 0
Thanked 1 Time in 1 Post
[SOLVED] Dropped Float

When I started my stylesheet, everything was well under control ... then I started trying to fix odd and ends of things ... now my floated sidebar has dropped down below the content div. I have added and deleted so many things to my css as I was tweaking things that I have no idea what caused the div to drop, and I no longer have any idea what attributes are necessary in my styles, and what are superfluous. Could you please tell me what is wrong with my code to cause the sidebar to become misplaced? I feel like I am wandering aimlessly in a sea of code and rules right now.

I can't give you the url because geocities makes everything even worse. I have attached a skeleton of the html code, and my css stylesheet. None of the text has been styled yet. Thanks in advance for any suggestions you might have.
Attached Files
File Type: css Peggy3.css (1.0 KB, 11 views)

Last edited by WebMachine; Nov 26th, 2007 at 00:39. Reason: add html file
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Nov 26th, 2007, 00:41
Junior Member
Join Date: Aug 2007
Location: Markham, Ontario
Age: 55
Posts: 33
Thanks: 0
Thanked 1 Time in 1 Post
Re: Dropped Float

Quote:
Originally Posted by WebMachine View Post
When I started my stylesheet, everything was well under control ... then I started trying to fix odd and ends of things ... now my floated sidebar has dropped down below the content div. I have added and deleted so many things to my css as I was tweaking things that I have no idea what caused the div to drop, and I no longer have any idea what attributes are necessary in my styles, and what are superfluous. Could you please tell me what is wrong with my code to cause the sidebar to become misplaced? I feel like I am wandering aimlessly in a sea of code and rules right now.

I can't give you the url because geocities makes everything even worse. I have attached a skeleton of the html code, and my css stylesheet. None of the text has been styled yet. Thanks in advance for any suggestions you might have.
Attached Files
File Type: html skeleton.html (1.4 KB, 8 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Nov 26th, 2007, 01:01
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Dropped Float

Oh you were sooooooooooooo close! Here is the one piece of css you need to change:

Code: Select all
#content {width: 520px;
        height: 100%;
        float: left;
        clear: right;
        font-family: Arial, Verdana, sans-serif;
        padding-top: 15px;
        padding-bottom: 15px;
        border-right: 2px solid rgb(255,0,153);}
By getting rid of the margin-right: 260px you have now allowed the sidebar the ability to move up.
AND by reducing the width of this div to 520px instead of 526px, you now have room for both to sit side by side!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Nov 26th, 2007, 01:23
Junior Member
Join Date: Aug 2007
Location: Markham, Ontario
Age: 55
Posts: 33
Thanks: 0
Thanked 1 Time in 1 Post
Re: Dropped Float

Thanks so much! I guess this gets better with experience, but now it seems like the more I fiddle with my original code, the more I lose track of what some of the positioning attributes are really doing to the page.

Now on to my next problem ... the sidebar is moved up, but I have a 5px tall image of a gradient the same width as the sidebar that I have repeating vertically for the length of the sidebar. This image is to go right up against the right border of the content area, but there is a fairly large gap between the two. I also want to make the sidebar the same length as the content area. Any chance of some help there?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Nov 26th, 2007, 01:35
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Dropped Float

This part in the css:
Code: Select all
#sidebar {float: right;
        width: 250px;
        height: 100%;
        margin-left: 2px;
        background: url(images/sidebar.jpg) 100% repeat-y;}
That "100%" is not correct there. Try using this instead:
Code: Select all
background: url(images/sidebar.jpg) top left repeat-y;
That should push it against the edges. If it's not touching the other side, try making the image wider...

About making the sidebar longer, this can only be achieved by padding. But let me ask, why? It looks fine the way it is...
But, if you insist, try adding this:
Code: Select all
#sidebar {float: right;
        width: 250px;
        height: 100%;
        margin-left: 2px;
        background: url(images/sidebar.jpg) top right repeat-y;
        padding-bottom: 150px; /* adjust this to your needs */
        }
Hope that helps!

Cheers
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Nov 26th, 2007, 11:23
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Dropped Float

To make two columns the same height NO matter what amount of content is inside is best achieved by the use of "faux columns".
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Dec 5th, 2007, 19:06
Junior Member
Join Date: Nov 2007
Location: earth
Age: 30
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Dropped Float

good lesson, i learn alot from this
who know, maybe one day i will need this
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Dec 5th, 2007, 20:02
Junior Member
Join Date: Aug 2007
Location: Markham, Ontario
Age: 55
Posts: 33
Thanks: 0
Thanked 1 Time in 1 Post
Re: Dropped Float

I learned alot too ... Thanks so much.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slice it, or float it? Inkers Web Page Design 2 Nov 13th, 2007 18:03
[SOLVED] FF behaving badly. Nav bar dropped by 13px frinkky Web Page Design 3 Oct 26th, 2007 23:28
[SOLVED] Problem with float - In mozilla jram Web Page Design 4 Oct 20th, 2007 06:11
Problems with float:left float:right nvidiajoe Web Page Design 8 Nov 17th, 2006 20:24


All times are GMT. The time now is 01:21.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42