Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-24-2008, 04:11 AM   PM User | #1
harper74
New to the CF scene

 
Join Date: Jan 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
harper74 is an unknown quantity at this point
Making one DIV fit inside another DIV

I have a (left) column in a "liquid" template page that extends below what should be the bottom of the page. I'm not sure how to make it fit.

http://flahotproperties.com

Suggestions? Solutions?
harper74 is offline   Reply With Quote
Old 01-24-2008, 09:58 AM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,697
Thanks: 5
Thanked 875 Times in 850 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
Yeah, this is happening because you positioned your left column absolutely. This is taking it out of the natural flow of elements and it has no influence whatsoever on other elements on that level in the DOM tree. Use floats to get your columns side by side and clear that float (as you’ve done already in the footer).
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 01-27-2008, 02:15 AM   PM User | #3
harper74
New to the CF scene

 
Join Date: Jan 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
harper74 is an unknown quantity at this point
In that Section DW8 gives me choices of Absolute, Fixed, relative and Static. All but Absolute result in the page being scrambled, so I guess I'm not getting it yet. I didn't "do" the footer, this is a reworked template. I'm extremely green at this.
harper74 is offline   Reply With Quote
Old 01-27-2008, 06:38 AM   PM User | #4
Majoracle
Regular Coder

 
Join Date: Nov 2006
Posts: 246
Thanks: 13
Thanked 26 Times in 24 Posts
Majoracle is an unknown quantity at this point
Just replace these 2 styles:
Code:
#leftColumn {
	width: 169px;
	position: absolute;
	left: 28px;
	top: 212px;
	height: 921px;
		}
#rightColumn {
		width: 176px;
		position: absolute;
		right: 27px;
		}
With:
Code:
#leftColumn {
	width: 169px;
	float:left;
	height: 921px;
		}
#rightColumn {
		width: 176px;
		float: right;
		}
That'll fix the right and left columns (though the right doesn't appear broken). A good thing to remember is that absolute positioning is almost never recommend for the very reason VIPStephan said.

Last edited by Majoracle; 01-27-2008 at 06:50 AM..
Majoracle is offline   Reply With Quote
Old 01-27-2008, 03:18 PM   PM User | #5
harper74
New to the CF scene

 
Join Date: Jan 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
harper74 is an unknown quantity at this point
Now I see it. No position at all. That works great.

Thanks!

My next question is how do I stop my #innerwrapper (center content white area) from shrinking shorter than the left and right columns on a wide screen display?

Last edited by harper74; 01-27-2008 at 06:26 PM..
harper74 is offline   Reply With Quote
Old 01-27-2008, 11:23 PM   PM User | #6
Majoracle
Regular Coder

 
Join Date: Nov 2006
Posts: 246
Thanks: 13
Thanked 26 Times in 24 Posts
Majoracle is an unknown quantity at this point
Simple. Use the clearfix technique.

Add this too your CSS:
Code:
.clearfix:after {
    content: "."; 
    display: block; 
    height: 0; 
    clear: both; 
    visibility: hidden;
}

.clearfix {display: inline-block;}

/* Hides from IE-mac \*/
* html .clearfix {height: 1%;}
.clearfix {display: block;}
/* End hide from IE-mac */
Then add the class to your innerWrapper div:
Code:
<div id="innerWrapper" class="clearfix">
This makes it clear the right and left floating columns. If you're curious about how it works, look over this: http://www.positioniseverything.net/easyclearing.html
Majoracle is offline   Reply With Quote
Old 01-28-2008, 01:47 AM   PM User | #7
harper74
New to the CF scene

 
Join Date: Jan 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
harper74 is an unknown quantity at this point
That's perfect! Thank you, thank you!

It's interesting that it doesn't appear correctly in DW8 design view, but it works just fine in the view browser.
harper74 is offline   Reply With Quote
Old 01-28-2008, 02:32 AM   PM User | #8
harper74
New to the CF scene

 
Join Date: Jan 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
harper74 is an unknown quantity at this point
Not quite perfect --- It's a mess in IE-7.

It's ok in IE6, Netscape, even Opera, Safari and Camino.
harper74 is offline   Reply With Quote
Old 01-28-2008, 03:00 AM   PM User | #9
Majoracle
Regular Coder

 
Join Date: Nov 2006
Posts: 246
Thanks: 13
Thanked 26 Times in 24 Posts
Majoracle is an unknown quantity at this point
Try adding class="clearfix" to the "wrapper" div too. Not 100% on if it'll fix it, but it seems like the most probable cause. IE in general is a huge pain in the butt.

Last edited by Majoracle; 01-28-2008 at 05:14 AM..
Majoracle is offline   Reply With Quote
Old 01-28-2008, 03:39 PM   PM User | #10
jerry62704
Senior Coder

 
jerry62704's Avatar
 
Join Date: Oct 2007
Location: Springfield, IL
Posts: 1,077
Thanks: 13
Thanked 84 Times in 84 Posts
jerry62704 is on a distinguished road
I've seen the 'content: ".";', but I'm not sure what it means. Do you have the short version on it?
jerry62704 is offline   Reply With Quote
Old 01-30-2008, 04:17 AM   PM User | #11
harper74
New to the CF scene

 
Join Date: Jan 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
harper74 is an unknown quantity at this point
Class ="clearfix" did the trick! Thanks!
harper74 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:08 AM.


Advertisement
Log in to turn off these ads.