123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <!DOCTYPE html>
- <html>
- <head>
- <style>
- html,
- body {
- height: 100%;
- margin: 0;
- padding: 0;
- }
- .container {
- display: flex;
- height: 100%;
- }
- .left-panel {
- flex: 1;
- background-color: #f1f1f1;
- padding: 20px;
- }
- .right-panel {
- flex: 1;
- padding: 20px;
- }
- .button {
- display: block;
- margin-bottom: 20px;
- padding: 10px 20px;
- background-color: #3498db;
- color: #fff;
- border: none;
- cursor: pointer;
- transition: background-color 0.3s ease;
- }
- .button:hover {
- background-color: #2980b9;
- }
- #info {
- font-size: 16px;
- margin-bottom: 20px;
- }
- .interactive-button {
- display: inline-block;
- padding: 5px 10px;
- background-color: #3498db;
- color: #fff;
- border: none;
- cursor: pointer;
- transition: background-color 0.3s ease;
- }
- .interactive-button:hover {
- background-color: #2980b9;
- }
- input[type="text"] {
- padding: 10px;
- width: 200px;
- }
- </style>
- </head>
- <body>
- <div class="container">
- <div class="left-panel">
- <button class="button" onclick="showInfo('按钮1被点击')">按钮1</button>
- <button class="button" onclick="showInfo('按钮2被点击')">按钮2</button>
- <button class="button" onclick="showInfo('按钮3被点击')">按钮3</button>
- <button class="button" onclick="showInfo('按钮4被点击')">按钮4</button>
- <button class="button" onclick="showInfo('按钮5被点击')">按钮5</button>
- <button class="button" onclick="showInfo('按钮6被点击')">按钮6</button>
- </div>
- <div class="right-panel">
- <div id="info"></div>
- <button class="interactive-button" onclick="showMessage()">交互按钮</button>
- <input type="text" id="input" placeholder="在这里输入文本">
- </div>
- </div>
- <script>
- function showInfo(text) {
- document.getElementById("info").textContent = text;
- }
- function showMessage() {
- var inputText = document.getElementById("input").value;
- alert(inputText);
- }
- </script>
- </body>
- </html>
|