provide functions for calculating an element's width and height