There can be a problem with multiple divs having percentage width:
In this case it returns 100 as width for the inner div for me. I solved it by taking the width of the outer div.