crop_rotate
Run
<!DOCTYPE html> <html> <head> <style> #myDIV { height: 250px; width: 400px; padding: 10px; margin: 15px; border: 5px solid red; background-color: lightblue; } </style> </head> <body> <p>Click the button to get the height and width of div, including padding and border (using both offsetHeight and offsetWidth).</p> <button onclick="myFunction()">Try it</button> <div id="myDIV"> <b>Information about this div:</b><br> Height: 250px<br> Width: 400px<br> padding: 10px<br> margin: 15px<br> border: 5px<br> <p id="demo"></p> </div> <script> function myFunction() { var elmnt = document.getElementById("myDIV"); var txt = "Height including padding and border: " + elmnt.offsetHeight + "px<br>"; txt += "Width including padding and border: " + elmnt.offsetWidth + "px"; document.getElementById("demo").innerHTML = txt; } </script> </body> </html>
PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCjxoZWFkPg0KPHN0eWxlPg0KI215RElWIHsNCiAgaGVpZ2h0OiAyNTBweDsNCiAgd2lkdGg6IDQwMHB4Ow0KICBwYWRkaW5nOiAxMHB4Ow0KICBtYXJnaW46IDE1cHg7DQogIGJvcmRlcjogNXB4IHNvbGlkIHJlZDsNCiAgYmFja2dyb3VuZC1jb2xvcjogbGlnaHRibHVlOw0KfQ0KPC9zdHlsZT4NCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+IDo6LXdlYmtpdC1zY3JvbGxiYXJ7d2lkdGg6N3B4O2hlaWdodDo3cHg7fTo6LXdlYmtpdC1zY3JvbGxiYXItdHJhY2t7YmFja2dyb3VuZDojZmZmO306Oi13ZWJraXQtc2Nyb2xsYmFyLXRodW1ie2JvcmRlci1yYWRpdXM6NXB4O2JhY2tncm91bmQ6IzJmNDVmZjt9PC9zdHlsZT48L2hlYWQ+DQo8Ym9keT4NCg0KPHA+Q2xpY2sgdGhlIGJ1dHRvbiB0byBnZXQgdGhlIGhlaWdodCBhbmQgd2lkdGggb2YgZGl2LCBpbmNsdWRpbmcgcGFkZGluZyBhbmQgYm9yZGVyICh1c2luZyBib3RoIG9mZnNldEhlaWdodCBhbmQgb2Zmc2V0V2lkdGg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