box model problem

This is a discussion on "box model problem" within the Web Page Design section. This forum, and the thread "box model problem are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Apr 3rd, 2008, 15:58
Junior Member
Join Date: Apr 2008
Location: Glasgow
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
box model problem

hey guys

i've laid out three div layers on my page. left div and right div are held within container div.

the container alignment is set to right, the left div is set to float to the left.

this allows me to have the two div layers side by side.

i'm having difficulty with it though - even with the height of the left div fixed at 200px, it only shows if the content in the right div is equal to or greater than 200.

if the content in the right div is less than 200, both divs are only shown until the content in the right div ends.

how do i get the left div to stay the set height of 200px?
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 Apr 3rd, 2008, 16:11
welshstew's Avatar
Site Admin

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,707
Blog Entries: 14
Thanks: 3
Thanked 33 Times in 31 Posts
Re: box model problem

you will need to use the faux columns method for this.

Check out his article: http://www.alistapart.com/articles/fauxcolumns/
__________________
WelshStew Site Admin
If you think I've helped, click the "Thanks"
tierney rides tboard - uk site | xtreme wales - extreme clothing
WebForumz - facebook | LinkedIn
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
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 Apr 3rd, 2008, 17:49
Junior Member
Join Date: Apr 2008
Location: Glasgow
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: box model problem

said article indicated that css will stretch the div only as much as it needs to vertically.

my problem is that there IS content in the div that isn't being displayed.

the column that's floated to the left will only display as far down as there is content in the right.

surely if there is content in the left it should stretch to display that?
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 Apr 3rd, 2008, 17:55
Aso's Avatar
Aso Aso is offline
Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,341
Blog Entries: 2
Thanks: 11
Thanked 49 Times in 46 Posts
Re: box model problem

Quote:
with the height of the left div fixed at 200px, it only shows if the content in the right div is equal to or greater than 200.
This is most likely a float issue. According to the W3C spec, a float should be taken out of the document flow.

In your case, the left column (even though it's 200px high) will not push the container down. You need to clear the float in order to do so.

Use this slice of CSS on your container;
Code: Select all
#container:after { // replace #container with the id/class of your container
    content:".";
    display:block;
    height:0;
    clear:both;
    visibility:hidden;
}
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
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 Apr 3rd, 2008, 19:02
Junior Member
Join Date: Apr 2008
Location: Glasgow
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: box model problem

thanks for the replies guys, i really appreciate it.

tried the :after code, still not displaying the image.

it looks like this




tried on both the container div and the floating div.

i've been taught this way to lay out columns, having i been doing it wrong all along?!

the site is already using nested divs to layout the navigation on the left and content on the right. these are further nested. are they ALL wrong?!
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 Apr 3rd, 2008, 19:04
Junior Member
Join Date: Apr 2008
Location: Glasgow
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: box model problem

(the green and blue are just so i can see the layers at the moment. im converting it from tables) (the cart software all runs on tables).
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 Apr 3rd, 2008, 19:12
Aso's Avatar
Aso Aso is offline
Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,341
Blog Entries: 2
Thanks: 11
Thanked 49 Times in 46 Posts
Re: box model problem

Sorry artisites, but a link would really help. If you can't get it hosted, could you post the HTML and CSS you're having issues with?
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
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 Apr 3rd, 2008, 20:03
Junior Member
Join Date: Apr 2008
Location: Glasgow
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: box model problem

http://www.artisites.net/test.html

it's fine when there's pleanty text in the description because it brings the left div down.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Apr 3rd, 2008, 20:15
Junior Member
Join Date: Apr 2008
Location: Glasgow
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: box model problem

nevermind - i've separated the bottom related products div from outside the top container and now it's working, with the code you provided aso186.

thanks for all your help!
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
First image problem and inline list problem konnor5092 Web Page Design 8 Dec 1st, 2007 09:08
Box Model Hack? jwalker80 Web Page Design 4 Feb 2nd, 2007 02:10
Fluid box - without box model satoshy Web Page Design 5 Aug 3rd, 2005 03:24


All times are GMT. The time now is 19:08.


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