css: Attach a div to a Centered div

Problem

I have a centered div and was wondering how can i attach a div on its right, there is a title DIV on top, then the yellow centered DIV and this SOCIAL SHARING DIV I'd like to attach on the right.

Thank you!!!

image of my divs

Problem courtesy of: themike

Solution

Add it inside the yellow div, and position it as follows:

#yellowdiv { position: relative; }
#sidebar { position: absolute; left: 790px; top: 10px; }
Solution courtesy of: bfavaretto

Discussion

Try making the yellow div position:relative, put the sidebar div inside it and make it position:absolute with values of top:0 and right:-XXX where XXX is the width of the sidebar plus the margin you require.

Discussion courtesy of: Billy Moat

It would be perfectly feasible to use the yellow div as the parent element for the brown div; the social data is all relevant info to the video. In that case, if you want, use the following:

#video {
 position: relative;
}

#brown {
 position: absolute; top: 0; left: 100%; /* this guarantees that it'll line up at the very end of #video */
}
Discussion courtesy of: Vin Burgh

Demo

http://jsfiddle.net/KXvpV/1/

Code

HTML

<div id="one"></div>
<div id="two">
    <div id="social"></div>
</div>

CSS

#social { position: relative; top: 20px; right: -201px; }

‚Äč

Discussion courtesy of: GG.

This recipe can be found in it's original form on Stack Over Flow.