HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> div{ border: 1px solid black; width: 200px; margin-bottom: 20px; } </style> </head> <body> <h1>CSS padding Property</h1> <div>This is div.</div> <button onclick="myFunction()">Click Me</button> <script> var x = document.getElementsByTagName("div")[0]; function myFunction(){ x.style.padding = "50px"; } </script> <p><strong>Note</strong>: click on the button to apply css 'padding' property.</p> </body> </html>
OUTPUT
×

Save as Private