M9 1a8 8 0 1 0 0 16A8 8 0 0 0 9 1zm. Join Stack Overflow to learn, share knowledge, and build lukep bitcoin value career. M9 1a8 8 0 1 0 0 16A8 8 0 0 0 9 1zM8 15. How do I retrieve an HTML element’s actual width and height?
Therefore, avoid doing it too much. Note they belong to the element, not . Width can return 0 if you’ve done certain DOM modifications to the element recently. Under what circumstances does it return 0? I believe this does not have the issues that .
Height will round to the nearest integer. If you must support IE8, use . Its worth noting that the Object returned by this method is not really a normal object. NOTE: this answer was written in 2008. I tried it in chrome, firefox and ie-edge, I tried with jquery and without, and I tried it with and without box-sizing:border-box. Wasn’t aimed at answering the question – its already been answered.
Question or one of the answers. I suggest using HTML conditional comments to limit hack to old IEs that don’t support CSS2. Height should do, as suggested in previous post. However, if you just want to center the content, there is a better way of doing so. Assuming you use xhtml strict DOCTYPE. 0,auto property and required width in px to the body tag. The content gets center aligned to the page.