I\'d like to create a div with an arbitrary size, then display something on top of that div. What is the best way to position and size the overlay exactly as the div below i
I would suggest using css attributes to do this. You can use position:absolute to position an element on top of another.
For example:
Top!
Bottom!
and css
#container {position:relative;}
#on-top {position:absolute; z-index:5;}
#on-bottom {position:absolute; z-index:4;}
I would take a look at this for advice: http://www.w3schools.com/cssref/pr_class_position.asp
And finally here is a jsfiddle to show you my example
http://jsfiddle.net/Wgfw6/