I think you'll have to do this in code behind of the basewebpart. In the basewebpart override the Render method. Before base.Render, write the beginning tags of your 2 divs. After base.render write the end tags.
Then have all of your web parts inherit from BaseWebPart.
DISCLAIMER: I haven't tried this myself so I'm just spitballing here. But I think that will work.