for Theme and Layout examples look into the Theme and Layout Folders, there are the standard Themes and you can look how they work!
THe other problem: I Have it too! I also need to fix the portlet size, so that if the jsp content ist longer than the portlet width, the line just breaks to the next line or anything else like this.
You then need to adapt your theme. But at the end of the day, you still have to fight with HTML and different interpretation of HTML in the different browsers