File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Div layout problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Div layout problems" Watch "Div layout problems" New topic

Div layout problems

Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
OK, I have three sections (divs) to my page, title,navigationbar,body, and they are centered on the page, and relative.

I have a nested div inside the navigationbar section, and I want it to "dropdown" when I click on it, but when I do the following:

Not only does my button get longer, but so does the outer div, and the button get WAY bigger, not just 200 bigger?!

what am I doing wrong, and how do I make the button extend, but on top of all the other divs, do I need to mess with it's z-index?


Justin Fox
[ April 15, 2008: Message edited by: Bear Bibeault ]

You down with OOP? Yeah you know me!
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
If you alert currheightnum, what is the value you are seeing?

Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
I fixed it, sorry,

and yes i was accidently "+=" two strings, it was 25200 lol

but I rearranged the layout a bit, I moved the navigation bar
inside the body and made the "homemade" dropdown absolute inside the
body, but ontop of the navigation, this worked perfect.

You can look at the layout at

Justin Fox
I agree. Here's the link:
subject: Div layout problems
It's not a secret anymore!