移动端html demo
时间: 2023-07-25 09:42:12 浏览: 51
好的,下面是一个简单的移动端 HTML Demo:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mobile HTML Demo</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
}
.container {
width: 100%;
max-width: 600px;
margin: 0 auto;
padding: 20px;
}
h1 {
font-size: 24px;
font-weight: bold;
margin-bottom: 10px;
}
input[type="text"], input[type="email"] {
display: block;
width: 100%;
padding: 10px;
border: none;
border-radius: 5px;
margin-bottom: 10px;
font-size: 16px;
background-color: #f5f5f5;
}
textarea {
display: block;
width: 100%;
padding: 10px;
border: none;
border-radius: 5px;
margin-bottom: 10px;
font-size: 16px;
background-color: #f5f5f5;
}
button {
display: block;
width: 100%;
border: none;
border-radius: 5px;
padding: 10px;
font-size: 16px;
background-color: #007bff;
color: #fff;
cursor: pointer;
}
</style>
</head>
<body>
<div class="container">
<h1>Contact Us</h1>
<form>
<label for="name">Name:</label>
<input type="text" name="name" id="name" required>
<label for="email">Email:</label>
<input type="email" name="email" id="email" required>
<label for="message">Message:</label>
<textarea name="message" id="message" cols="30" rows="10" required></textarea>
<button type="submit">Submit</button>
</form>
</div>
</body>
</html>
```
该 Demo 包含一个简单的联系我们表单,其中包含输入姓名、邮箱和留言等几个表单项。同时,该 Demo 还包含了一些基本的 CSS 样式,能够适配移动端设备。