A rough sketch is on a fiddle here. Is there a way to make that happen without hardcoded values for the height and width of the div’s?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is what
transform-originis supposed to help with.I’ve looked at your fiddle. Do you need the div’s to be absolutely positioned? If not, then setting
transform-originto0 0is enough to make it work. (I’m supposing this is how you want it: http://jsfiddle.net/Actss/17/ )Removing the
position: absolutefrom the divs guarantees the seconddiv‘s top-left corner is touching the firstdiv‘s bottom-left corner. Make the rotation on the seconddivhappen at that same point (by usingtransform-origin) and you’ll get the effect you want.