以下是一个简短的范例,该范例展示了如何使用HTML、CSS和JavaScript创建一个简单的网页,其中包含一个按钮,点击按钮后会显示一条消息。
HTML (index.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Webpage Example</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<h1>Welcome to My Simple Webpage</h1>
<button id="myButton">Click Me!</button>
<p id="message"