LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How do I use CSS to set height of a section using % like frames (https://www.linuxquestions.org/questions/programming-9/how-do-i-use-css-to-set-height-of-a-section-using-like-frames-619931/)

Furrage 02-09-2008 11:43 AM

How do I use CSS to set height of a section using % like frames
 
I'm not sure if this is the right place to ask this, so if it is not please direct me where to go.

I want to create a simple webpage that has two sections. The top section must be 80% of the window's height regardless of the size of the window, or if the window is resized. Ordinarily I would use frames, but I understand the prefered technique now is to use CSS. How do I use CSS to do this?

So far I understand a style could be assigned with a height specified (eg. using a <div style="height: [something]"></div>). But percentages don't work for this parameter and I don't know how to get the pixel height of this parameter into the style when the window is sized.

Also with frames I could resize the frame by dragging the seperator between the top and bottom sections. How would I do this with CSS?

Nathanael 02-09-2008 01:15 PM

have you even tried using %?
i would suggest you have a little look at w3schools.com :)

Furrage 02-12-2008 10:21 AM

Problem was with Netbeans IDE
 
I went back and checked (using % as I had before), but did it in Notepad instead of the Netbeans 6 IDE. It turns out that it works with Notepad, but not with Netbeans (I don't have a clue why). Thanks for the help.

As for dragging the border between the top half and the bottom half, any suggestions?

JWPurple 02-12-2008 08:14 PM

These kind of things are complicated by CSS browser compatibility problems. See www.alistapart.com for some good general info on formatting with CSS.


All times are GMT -5. The time now is 06:10 AM.