css3 - margin top negative value issue css -


i have div inside div. need pull inside div out of container div. used following code. if use margin top in negative value container div move inside div. couldn't use position absolute alignment issue.

code:

    <div style="background-color:#999999; width:150px; height:300px;">         <div style="position:relative; width:100px; height:100px; background-color:#006633; margin-top:-50px;"></div> </div> 

how achieve position relative?

instead of margin-top use top

demo fiddle

top: -10px; 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -