运行 ❯
获取您
自己
的网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> #myDIV { margin-top: 20px; border: 1px solid black; background-color: lightblue; box-sizing: border-box; width: 300px; } </style> </head> <body> <h1>Change padding-inline-end with JavaScript</h1> <p>Click the "Try it" button to change the padding-inline-end property of the DIV element:</p> <button onclick="myFunction()">Try it</button> <div id="myDIV"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat... </div> <script> function myFunction() { document.getElementById("myDIV").style.paddingInlineEnd = "100px"; } </script> </body> </html>