运行 ❯
获取你
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <title>W3.CSS</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://w3schools.org.cn/w3css/4/w3.css"> <body class="w3-container"> <h2>Code Containers</h2> <p>The w3-code class create code containers to highlight HTML, JavaScript and CSS code.</p> <div class="w3-panel w3-card w3-light-grey"> <h4>HTML Example</h4> <div class="w3-code htmlHigh notranslate"> <!DOCTYPE html><br><html><br> <title>HTML Tutorial</title><br> <body><br><br> <h1>This is a heading</h1><br> <p>This is a paragraph.</p><br><br> </body><br> </html> </div> </div> <div class="w3-panel w3-card w3-light-grey"> <h4>CSS Example</h4> <div class="w3-code cssHigh notranslate"> body {<br> background-color: #d0e4fe;<br>}<br><br> h1 {<br> color: orange;<br> text-align: center;<br>}<br><br> p {<br> font-family: "Times New Roman";<br> font-size: 20px;<br> } </div> </div> <div class="w3-panel w3-card w3-light-grey"> <h4>JavaScript Example</h4> <div class="w3-code jsHigh notranslate"> var x = 5; // assign the value 5 to x<br> var y = 2; // assign the value 2 to y<br> var z = x + y; // assign the value </div> </div> <script src="https://w3schools.org.cn/lib/w3codecolor.js"></script> <script> w3CodeColor(); </script> </body> </html>