用css+html+js,编写一个旅游网的评价表单

时间: 2024-03-24 15:36:27 浏览: 20
好的,以下是一个简单的旅游网的评价表单的示例代码,你可以根据需要进行修改和优化: HTML代码: ```html <!DOCTYPE html> <html> <head> <title>旅游网评价表单</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <div class="form-container"> <h1>旅游网评价表单</h1> <form> <label for="name">姓名:</label> <input type="text" id="name" name="name" required> <label for="email">邮箱:</label> <input type="email" id="email" name="email" required> <label for="phone">电话:</label> <input type="tel" id="phone" name="phone" required> <label for="destination">旅游目的地:</label> <input type="text" id="destination" name="destination" required> <label for="rating">评分:</label> <select id="rating" name="rating" required> <option value="" disabled selected hidden>请选择评分</option> <option value="1">1分</option> <option value="2">2分</option> <option value="3">3分</option> <option value="4">4分</option> <option value="5">5分</option> </select> <label for="comment">评价:</label> <textarea id="comment" name="comment" required></textarea> <input type="submit" value="提交"> </form> </div> </body> </html> ``` CSS代码: ```css body { margin: 0; padding: 0; font-family: Arial, sans-serif; background-color: #f2f2f2; } .form-container { max-width: 500px; margin: 50px auto; background-color: #fff; padding: 20px; border-radius: 5px; box-shadow: 0 0 10px rgba(0,0,0,0.3); } h1 { text-align: center; margin-top: 0; } label { display: block; margin-bottom: 5px; } input[type="text"], input[type="email"], input[type="tel"], select, textarea { display: block; width: 100%; padding: 10px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; } textarea { height: 100px; resize: none; } input[type="submit"] { background-color: #4CAF50; color: #fff; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; } input[type="submit"]:hover { background-color: #3e8e41; } input[type="submit"]:focus { outline: none; } ``` JavaScript代码(可选): ```javascript // 可以使用 JavaScript 对表单进行验证和提交操作 ```

相关推荐

最新推荐

recommend-type

前端HTML5+CSS+JavaScript学习笔记.docx

前端HTML5+CSS+JavaScript详细学习笔记,来自菜鸟教程、w3cSchool和b站视频教程的总结,包括基础知识和示例代码,欢迎大家指正
recommend-type

纯js+html和纯css+html制作手风琴效果

本文分享了纯js+html制作手风琴和纯css+html制作手风琴两种效果,供大家参考,具体内容如下 一、纯css+html的手风琴效果 这种用css写的手风琴比较简单,主要是应用到css中的,transition属性。 代码如下: &lt;!...
recommend-type

利用js+css+html实现固定table的列头不动

话不多说,跟这小编来一起看下吧 ... //该函数在上面一个table数据加载完成后调用 //把表头的宽度设置到会滚动的页头去 var copyWidth = function () { var b = $('#data_tbody').prev().find('tr:last').fi
recommend-type

CSS+JS实现一个DIV层的展开折叠效果

CSS+JS实现一个DIV层的展开折叠效果,自己总结出来的,两天才解决的问题,分享出来,大家项目学习,交流。欢迎评论、指导
recommend-type

html+css 选择题50(加答案)

html+css 选择题(加答案),适合学过html和css的人加强和巩固知识(内有50个选择题)。
recommend-type

zigbee-cluster-library-specification

最新的zigbee-cluster-library-specification说明文档。
recommend-type

管理建模和仿真的文件

管理Boualem Benatallah引用此版本:布阿利姆·贝纳塔拉。管理建模和仿真。约瑟夫-傅立叶大学-格勒诺布尔第一大学,1996年。法语。NNT:电话:00345357HAL ID:电话:00345357https://theses.hal.science/tel-003453572008年12月9日提交HAL是一个多学科的开放存取档案馆,用于存放和传播科学研究论文,无论它们是否被公开。论文可以来自法国或国外的教学和研究机构,也可以来自公共或私人研究中心。L’archive ouverte pluridisciplinaire
recommend-type

实现实时数据湖架构:Kafka与Hive集成

![实现实时数据湖架构:Kafka与Hive集成](https://img-blog.csdnimg.cn/img_convert/10eb2e6972b3b6086286fc64c0b3ee41.jpeg) # 1. 实时数据湖架构概述** 实时数据湖是一种现代数据管理架构,它允许企业以低延迟的方式收集、存储和处理大量数据。与传统数据仓库不同,实时数据湖不依赖于预先定义的模式,而是采用灵活的架构,可以处理各种数据类型和格式。这种架构为企业提供了以下优势: - **实时洞察:**实时数据湖允许企业访问最新的数据,从而做出更明智的决策。 - **数据民主化:**实时数据湖使各种利益相关者都可
recommend-type

2. 通过python绘制y=e-xsin(2πx)图像

可以使用matplotlib库来绘制这个函数的图像。以下是一段示例代码: ```python import numpy as np import matplotlib.pyplot as plt def func(x): return np.exp(-x) * np.sin(2 * np.pi * x) x = np.linspace(0, 5, 500) y = func(x) plt.plot(x, y) plt.xlabel('x') plt.ylabel('y') plt.title('y = e^{-x} sin(2πx)') plt.show() ``` 运行这段
recommend-type

JSBSim Reference Manual

JSBSim参考手册,其中包含JSBSim简介,JSBSim配置文件xml的编写语法,编程手册以及一些应用实例等。其中有部分内容还没有写完,估计有生之年很难看到完整版了,但是内容还是很有参考价值的。