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
Giving two <div> the same height
Old 10-24-2008, 05:11 PM Giving two <div> the same height
Average Talker

Posts: 17
Trades: 0
Hi,
I'm fairly new to CSS, and hopefully this is a simple task, but I cant seem to fix it anyway!

I'm not quite sure how to explain this, so I think it's better for you to see the website: http://www.sauda.net/demo
As you can see, the two articles I've called "Trouble <DIV>s" have some difference in height... I would like them both to have the height "required" by the largest article.
That means that in my example on the website I posted, the left article would have some white space under it so that it would "line up" with the right article.
How can I do this?

My CSS-file: 3.css
MrConn is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-24-2008, 06:27 PM Re: Giving two <div> the same height
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Welcome to the forum MrConn.

We just had the same question a few days ago in this thread. See if the information there helps.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 10-25-2008, 08:12 AM Re: Giving two <div> the same height
Average Talker

Posts: 17
Trades: 0
Thanx, but I dont think this would help me... You see I dont want a min height... I want them to have the same height.
The text in the divs will be updated by php/mysql, so if the right <div> is the largest one and requires 500px I want the left one to be 500px also... But if the left <div> is the largest one and requires 550px I would like the right one to be 550px to...
MrConn is offline
Reply With Quote
View Public Profile
 
Old 10-25-2008, 08:52 AM Re: Giving two <div> the same height
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
You're not thinking like an illusionist! I doubt that what you really need is two divs of the same height, but rather two divs that APPEAR to be of the same height. You should read about faux columns.

***EDIT***
on further examination of your code, your problem has nothing to do with needing heights at all, but rather that your #footer is not clearing your floats properly.

Change the statement inside of the block beginning around line 215 in 3.css from {clear: left} to {clear: both}. This will clear the "trouble div" on the right also, which will always give you space you badly need at the bottom.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.

Last edited by wayfarer07; 10-25-2008 at 09:04 AM..
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 10-25-2008, 08:57 AM Re: Giving two <div> the same height
Average Talker

Posts: 17
Trades: 0
Hehe!
I'll read up on your link. Thank you
MrConn is offline
Reply With Quote
View Public Profile
 
Old 10-25-2008, 09:00 AM Re: Giving two <div> the same height
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
I'll get a link drop in

http://www.candsdesign.co.uk/article...eight-columns/
__________________
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 offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-25-2008, 09:03 AM Re: Giving two <div> the same height
Skilled Talker

Posts: 52
Name: Bruce
Trades: 0
You're only wanting them to be the same height so that their header, read more link, image etc. will all line up with each other, correct?

Well there are only three things that I know of that can be done to accomplish this.

1. Have a character limit and try to ensure that the text in each item, (of course the very last item doesn't matter) is about the same and all wrap the same amount of lines.

2. Increase the width of whatever is restricting the headers so that larger headers will not wrap. Of course this isn't a great option in your case, but you could maybe increase the width some and then also include a character limit and the two together may work great.

3. Set a min-height on each text item except the last one, this way the headers, read more link etc. will line up their tops with each other. There will be more vertical space separating each item if they vary in the amount of lines they wrap, of course.

And if you have a different background for those columns or if you have borders around them then you'd probably also want to use the faux columns technique that was recommended to you already. If you have the same color behind them both as in your demo then you don't need faux columns, obviously. lol That's all I thought you were needing also until I checked out your demo.

Edit: After rereading your post it does look like you are talking about the footer problem. Well whatever you were wanting I think you have your answer out of all the posts here.

Last edited by SillyWilly; 10-25-2008 at 09:17 AM..
SillyWilly is offline
Reply With Quote
View Public Profile
 
Old 10-25-2008, 12:00 PM Re: Giving two <div> the same height
Average Talker

Posts: 17
Trades: 0
I will not be able to check any of your suggestions untill tomorrow, since... Well it's saturday! :P
But thank you for all your help!
And dont worry, I'll tell you if I still cant do it! :P

Have a great evening!
MrConn is offline
Reply With Quote
View Public Profile
 
Old 10-25-2008, 08:28 PM Re: Giving two <div> the same height
Sean@WMS's Avatar
Skilled Talker

Posts: 52
Name: Sean Connors
Location: Eureka, CA USA
Trades: 0
Lemme guess: you're looking at your site in IE and not FireFox, no? If you peep it in FF, you'll see what the others are reacting to here.

However, even after you fix that mess, I don't see how you could get these divs in the arrangement you have them to have the same height fluid with the content in them. You might want to consider using CSS's overflow if you want the space all evened out between the two columns independent of what's filling their content.

There is a trick where you can get two floated divs to appear with the exact same height independent of which has more content where you give a really large margin-bottom and then an equal negative padding-bottom and then hide the overflow, but I don't know if that will work for you here, and I don't have time to play with it right now.
__________________
Web Merchant Services

Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE
Sean@WMS is offline
Reply With Quote
View Public Profile Visit Sean@WMS's homepage!
 
Old 10-26-2008, 01:00 AM Re: Giving two <div> the same height
Skilled Talker

Posts: 52
Name: Bruce
Trades: 0
Oh I just now checked your website in IE and I see you have more problems than I thought. Did you check your website in other browsers? You'll see more problems. I'm too sleepy to look at your code right now though.
SillyWilly is offline
Reply With Quote
View Public Profile
 
Old 10-27-2008, 01:25 PM Re: Giving two <div> the same height
Average Talker

Posts: 17
Trades: 0
Thank you for your help!
I finally made it by changing both the css and html a little...
After inserting "overflow: hidden;" and changing the html a little it worked great!

You can see it here: http://www.sauda.net/demo
MrConn is offline
Reply With Quote
View Public Profile
 
Old 10-27-2008, 01:43 PM Re: Giving two <div> the same height
Sean@WMS's Avatar
Skilled Talker

Posts: 52
Name: Sean Connors
Location: Eureka, CA USA
Trades: 0
Quote:
Originally Posted by MrConn View Post
Thank you for your help!
I finally made it by changing both the css and html a little...
After inserting "overflow: hidden;" and changing the html a little it worked great!

You can see it here: http://www.sauda.net/demo
Still needs a little help in FF if you want your heading divs to the right of your image icons rather than below them. Also, in IE 6, there's an issue with your column 3 background not showing in the right place. That's a tricky little bugger I've wrestled with before, but it has to do with an extra 3 or 4 (4 if there is bordering) px IE 6 mysteriously throws in as a sort of phantom border. You'll have to write rules for IE6 in particular to deal with that.
__________________
Web Merchant Services

Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE
Sean@WMS is offline
Reply With Quote
View Public Profile Visit Sean@WMS's homepage!
 
Old 10-27-2008, 02:11 PM Re: Giving two <div> the same height
Average Talker

Posts: 17
Trades: 0
I'll deal with bugs when I'm "done" with the rest of the page, but thanx for the input
MrConn is offline
Reply With Quote
View Public Profile
 
Old 10-27-2008, 03:16 PM Re: Giving two <div> the same height
Experienced Talker

Posts: 39
Trades: 0
Check this site for how to trouble shoot css and fix issues. http://www.w3.org/Style/CSS/
__________________
Omnistar Etools offers Web Software Solutions for Businesses that include
Please login or register to view this content. Registration is FREE
and
Please login or register to view this content. Registration is FREE
software
Visit
Please login or register to view this content. Registration is FREE
for more information.
omnistar is offline
Reply With Quote
View Public Profile
 
Old 10-27-2008, 03:41 PM Re: Giving two <div> the same height
Average Talker

Posts: 17
Trades: 0
Will do, thanx!

EDIT:
After a little validation and some deleting of "dead" code the page now looks good in FF also

Last edited by MrConn; 10-27-2008 at 03:51 PM..
MrConn is offline
Reply With Quote
View Public Profile
 
Old 10-27-2008, 05:50 PM Re: Giving two <div> the same height
Average Talker

Posts: 17
Trades: 0
If you could check it now and see for any errors that would be great!
MrConn is offline
Reply With Quote
View Public Profile
 
Old 10-27-2008, 06:05 PM Re: Giving two <div> the same height
Sean@WMS's Avatar
Skilled Talker

Posts: 52
Name: Sean Connors
Location: Eureka, CA USA
Trades: 0
Looks good . . . . though there's still that issue with column 3 in IE 6.
__________________
Web Merchant Services

Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE
Sean@WMS is offline
Reply With Quote
View Public Profile Visit Sean@WMS's homepage!
 
Old 10-27-2008, 06:11 PM Re: Giving two <div> the same height
Average Talker

Posts: 17
Trades: 0
Will check that out...
Thanx
MrConn is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Giving two <div> the same height
 

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