close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to make a DIV's height 100%?

Thread began 12/05/2009 11:01 am by keithlogan347721 | Last modified 12/08/2009 3:00 pm by keithlogan347721 | 2654 views | 7 replies |

keithlogan347721

How to make a DIV's height 100%?

Hi

I'm using CSS Sculptor for the first time. I'm using one of the layouts included i.e a 3 Column layout with fixed header and footer. I've made the footer stick to the bottom of the browser.

Here's my problem. The center column holds the main content, I want this div to fit exactly all the way down until it hits the sticky footer. How do I do that?

I've attached a screen grab. You will see the center DIV colored in Brown, notice how it sits way up the page. I need it to fit vertically until it meets the Footer.

Any help would be much appreciated.

Sign in to reply to this post

neilo

The easiest way is to give the appearance of 100% height by giving the page a background image - centered, repeat-y. (Faux columns).

Once you have decided finally on your left and right column and content area widths, create an image same width as content wrapper, and about 20px in height, and colour the column areas as you want them to appear in your page.(add borders, effects as required) i.e:

faux/

Sorry about the colour scheme!

Edit note: To use this method, you would need to remove the existing background colours from your outerwrapper and its contained elements.

Alternatively, you could make the outerWrapper, contentWrapper and content divs 100% height, and set the property of contentWrapper overflow from 'hidden' to 'visible'(for editing in DW design view).
index2.html

Sign in to reply to this post

keithlogan347721

Thanks, works perfectly now!

Cheers

Sign in to reply to this post

keithlogan347721

Hi again,

I'm actually having a problem when viewing this page in IE surprise surprise, If you view the following page in IE7 you will see that the right hand column is being cut off by the footer. Any ideas on how to fix this in IE? It works great in Firefox and Safari.

test.htm

Thanks

Sign in to reply to this post

Eric Mittman

When you crafted your layout in Sculptor did you check the box for equal length columns in the interface? This option in the interface is there to help with the situations like this. If you have this option enabled before you generate the page it should account for the columns in the layout and apply the technique that will make them equal. You can always go to the CSS Sculptor interface and it should have the preset you were last working on.

Sign in to reply to this post

keithlogan347721

Hi,

I did choose the option for the box for equal length columns in the interface. Have I missed something else?

I managed to find a workaround by adding a bottom margin to the right hand column. Would you have a better workaround?

Thanks

Sign in to reply to this post

neilo

Hi Keith,

You can force the div (content2) to properly 'contain' all of it's contents, with a snippet of code, immediately before the closing div tag for that div. The code is:

<br style="clear:both; height:0; font-size: 1px;line-height: 0px" />


and you should put it in your page code here:

Ayurveda can also boast that it is the only medical system that treats, prevents and diagnoses. </p>
<br style="clear:both; height:0; font-size: 1px;line-height: 0px" />
</div>



You would then just need to click 'return' after the last word in your right column, to make things fine in IE.

Might be worth a try on your page, if not, it's a useful bit of code to keep handy whenever you need a div to 'contain' its contents properly!

Sign in to reply to this post

keithlogan347721

Hi neilo,

This is a great snippet indeed, thank you very much for sharing!

Regards

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...