新建文本文档→复制进入→将后缀改成html
<style> body { background: linear-gradient(180deg, #A1C4FD, #C2E9FB, #FBC2EB, #FF9A9E); } .asdf{ width: 100%; height: auto; display: flex; flex-direction: column; align-items: center; vertical-align: center; //background-color: red; } .card { width: 350px; padding: 20px; border-radius: 12px;
background-color: #f7f7f9; /* 淡淡的灰白色卡片背景 / box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); color: #555; / 中性灰色文本 / text-align: center; } .card h3 { line-height: 60px; // margin-bottom: 10px; font-size: 22px; color: #333; / 深灰色标题 / } .card p { margin-bottom: 20px; font-size: 16px; line-height: 1.6;
padding: 0 20px } .card button { padding: 10px 20px; background-color: #aacfd0; / 柔和的青绿色按钮 / border: none; border-radius: 6px; color: white; font-size: 16px; cursor: pointer; transition: background-color 0.3s ease; margin-bottom: 30px; } .card button:hover { background-color: #88b8b9; / 悬停时稍微加深颜色 */
}.inlinea{ text-decoration: none; color: #fff; } </style> </html> <div class="asdf"> <div class="card"> <h3 id="title2">Welcome</h3> <p>Follow me please! <br>点击下方按钮关注我!</p> <button><a href="https://www.acgo.cn/person/4263885" class="inlinea" style="color: white">Get Started</a></button> </div>
</div> </html> <script> var k = document.getElementById("title2"); k.addEventListener("click", function(){ window.alert("被你发现了!"); }) </script>