运行 ❯
获取您的
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> #myDIV { background-color: coral; height: 300px; width: 80%; margin: auto; color: white; writing-mode: vertical-lr; text-orientation: mixed; } </style> </head> <body> <h1>Change text-orientation with JavaScript</h1> <p>Click the "Try it" button to change text orientation of the DIV element from "mixed" to "upright":</p> <button onclick="myFunction()">Try it</button> <div id="myDIV"> <h1>myDIV</h1> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam semper diam at erat pulvinar, at pulvinar felis blandit.</p> </div> <script> function myFunction() { document.getElementById("myDIV").style.textOrientation = "upright"; } </script> </body> </html>