HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> div{ width: 300px; height: 100px; padding: 25px; text-align: center; border: 1px solid #8c8c8c; box-sizing: content-box; } </style> </head> <body> <h1>CSS box-sizing property</h1> <div> My Container </div> <button onclick="myFunction()">Click Me</button> <script> var x = document.getElementsByTagName("div")[0]; function myFunction(){ x.style.boxSizing = "border-box"; } </script> <p><strong>Note</strong>: Click on the button to change the 'box-sizing' from content-box to border-box.</p> </body> </html>
OUTPUT
×

Save as Private