This was discussed on SitePoint.com , and it seemed the best way to do this was to embed the div in the div and use the negative fields to position it correctly, which I think you don't want to do.
What you are trying to do is very similar to the fieldset legend for forms, and you can use this html and style it with CSS to customize it. Examples
source share