Div position problem

If you don’t set a width for the element and it is a static element then it will stretch as wide as its containing block. If the containing block is the viewport then that means it will be 100% wide and stretch from edge to edge. If the element is inside a parent of fixed width then the inner element will only be as wide as the parent.

Ok I know about the span now but based on the link here http://183.78.169.54/tree/2.html how did it manage to control the item in it smoothly by expand and collapsing?

I’m not sure I see what you are getting at but the span does nothing special. It’s just a container for the plus and minus background image. It’s the JS that opens and closes the menu and changes the class on the span to reveal the correct + or - image.

Dear Paul,
Regarding the span I saw in the css this. What I know is when collapsed is replace it with the image and the same goes when expand but beside that how can it like close or open the list? Both of this is set accordingly in the js script at this line this.className = (ul.style.display == “none”) ? “collapsed” : “expanded”;

sitemap li span, sitemap li span.collapsed{background:url(collapsed.gif) no-repeat 0 0;}
sitemap li span.expanded{background:url(expanded.gif) no-repeat 0 0;}

I’m not sure what you are getting at still as you seem to have answered your own question.

When the page is loaded the JS cycles through and appends an empty span to the uls to show the plus sign. When the plus sign is clicked the js says if the ul is display:block then set it to display:none and change the span to hold the minus image.


ul.style.display = (ul.style.display == "none") ? "block" : "none"; this.className = (ul.style.display == "none") ? "collapsed" : "expanded";

Dear Paul,
Ok finally I understand it now. Another thing if you notice in this <div id=“rightcolumn”> I build the form using the table method is that ok or your recommend something else? Thank you.

I don’t use tables for forms and usually do something like this. Some people use tables for forms but the data isn’t really tabular as far as I am concerned.

Dear Paul,
I have now this page http://183.78.169.54/tree/3.html. First at the top div I have a logo then beside it I want a long image as a background but I want to be able to write text on it dynamically how to do that? The same goes for the bottom div too I notice there is a space between the image and the bottom? Then I also want to put text over the image too?