With divs. if you google it you will find a lot of examples. http://www.dustindiaz.com/dhtml-expand-and-collapse-div-menu/
You need to use HTML elements like DIVs and use javascript to edit their size and location. Search online for examples. You'll find loads.
To achieve expanding and collapsing of content, you have to combine <div> and javascript. By using JavaScript you will be changing the <div>'s style.display property. Lots of examples are available on the net.