自己做的注册页面的界面代码 (学习HTML过程中的小记录)

自己做的注册页面的界面代码 (学习HTML过程中的小记录)     作者:王可利(Star·星星)

 

 

效果的样式  

 

 

主要是运用了:单标签、input  form

                 text=文本  password=密文输入  radio=单选    checkbox =多选   vlaue=输入框里面要写的字  textarea=复写框

                 button=普通的按钮  submit=提交按钮 reset=重置按钮 

 

 

代码如下:

  1 <html>
  3 <head>
  5 <meta charset="UTF-8">
  6 
  7 <title>(注册页面)</title>
  8 
  9 </head>
 10 
 13 <body>
 14 
 15 <h2>欢迎注册“你的星星我的网站”</h2>
 18 
 19 <form>
 22 
 23 请输入你de名字 : <input type="text" name="账号" value="可爱滴名字哟!嘎嘎~"> 
 26 
 27 <br><br>
 30 
 31 请输入你de密码 : <input type="password" name="密码" value="密文很安全哦~~ ^_^">
 34 
 35 <br><br>
36 39 你是GG还是MM呀~ : <input type="radio" name="sex">GG <input type="radio" name="sex">MM <input type="radio" name="sex">不告诉你 40 41 42 43 <br><br> 44 47 请选择你de学历哟 : <input type="radio" name="study">幼儿园 48 49 <input type="radio" name="study">小学 50 51 <input type="radio" name="study">初中 52 53 <input type="radio" name="study">高中 54 55 <input type="radio" name="study">大学 56 57 <input type="radio" name="study">硕士 58 59 <input type="radio" name="study">博士 60 61 <input type="radio" name="study">更高,更厉害! 62 63 64 65 <br><br> 69 请选择你de爱好? : <input type="checkbox" name="love">睡觉 70 71 <input type="checkbox" name="love">吃饭 72 73 <input type="checkbox" name="love">踢足球 74 75 <input type="checkbox" name="love">打篮球 76 77 <input type="checkbox" name="love">打乒乓球 78 79 <input type="checkbox" name="love">打豆豆 80 81 <input type="checkbox" name="love">打代码 84 85 <br><br> 88 89 你都会玩什么技能呀 : <input type="checkbox" name="work">HTML 90 91 <input type="checkbox" name="work">CSS 92 93 <input type="checkbox" name="work">JS 94 95 <input type="checkbox" name="work">IOS 96 97 <input type="checkbox" name="work">C语言 100 101 <br><br> 104 105 <p>你来自哪里呀?<select> 106 107 <option vlaue="北京">北京</option> 108 109 <option vlaue="上海">上海</option> 110 111 <option vlaue="广州">广州</option> 112 113 <option vlaue="深圳">深圳</option> 114 115 </select></p> 118 119 <p>签名 : <textarea rows="6" cols="100">请输入你的签名呀~~</textarea></p> 122 123 <p>普通按钮:<button>我是一个可爱的按钮</button></p> 126 127 <p>提交按钮:<input type="submit" value="提交"></p> 130 131 <p>重置按钮:<input type="reset" value="重置"></p> 132 133 </form> 134 135 </body> 136 137 </html>

 

 

转载于:https://www.cnblogs.com/StarKL/p/6007408.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的JavaEE阅读记录界面代码示例,其使用了JSP和Servlet: 1. 阅读记录界面的JSP页面(read.jsp): ```jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>阅读记录</title> </head> <body> <h1>阅读记录</h1> <table> <tr> <th>书名</th> <th>作者</th> <th>阅读时间</th> <<th>操作</th> </tr> <c:forEach var="book" items="${books}"> <tr> <td>${book.title}</td> <td>${book.author}</td> <td>${book.date}</td> <td><a href="${pageContext.request.contextPath}/delete?id=${book.id}">删除</a></td> </tr> </c:forEach> </table> <br> <form action="${pageContext.request.contextPath}/add" method="post"> 书名:<input type="text" name="title"><br> 作者:<input type="text" name="author"><br> 阅读时间:<input type="date" name="date"><br> <input type="submit" value="添加"> </form> </body> </html> ``` 2. Servlet控制器(BookServlet.java): ```java package com.example.controller; import java.io.IOException; import java.sql.SQLException; import java.util.List; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.example.dao.BookDao; import com.example.model.Book; @WebServlet("/read") public class BookServlet extends HttpServlet { private static final long serialVersionUID = 1L; private BookDao bookDao; public BookServlet() { super(); bookDao = new BookDao(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { List<Book> books; try { books = bookDao.getAllBooks(); request.setAttribute("books", books); request.getRequestDispatcher("/read.jsp").forward(request, response); } catch (SQLException e) { e.printStackTrace(); response.getWriter().append("Error: " + e.getMessage()); } } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String title = request.getParameter("title"); String author = request.getParameter("author"); String date = request.getParameter("date"); Book book = new Book(title, author, date); try { bookDao.addBook(book); response.sendRedirect(request.getContextPath() + "/read"); } catch (SQLException e) { e.printStackTrace(); response.getWriter().append("Error: " + e.getMessage()); } } protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { int id = Integer.parseInt(request.getParameter("id")); try { bookDao.deleteBook(id); response.sendRedirect(request.getContextPath() + "/read"); } catch (SQLException e) { e.printStackTrace(); response.getWriter().append("Error: " + e.getMessage()); } } } ``` 3. DAO类(BookDao.java): ```java package com.example.dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import com.example.model.Book; import com.example.utils.DbUtils; public class BookDao { private Connection conn; public BookDao() { conn = DbUtils.getConnection(); } public List<Book> getAllBooks() throws SQLException { List<Book> books = new ArrayList<>(); String sql = "SELECT * FROM books"; PreparedStatement stmt = conn.prepareStatement(sql); ResultSet rs = stmt.executeQuery(); while (rs.next()) { int id = rs.getInt("id"); String title = rs.getString("title"); String author = rs.getString("author"); String date = rs.getString("date"); Book book = new Book(id, title, author, date); books.add(book); } rs.close(); stmt.close(); return books; } public void addBook(Book book) throws SQLException { String sql = "INSERT INTO books (title, author, date) VALUES (?, ?, ?)"; PreparedStatement stmt = conn.prepareStatement(sql); stmt.setString(1, book.getTitle()); stmt.setString(2, book.getAuthor()); stmt.setString(3, book.getDate()); stmt.executeUpdate(); stmt.close(); } public void deleteBook(int id) throws SQLException { String sql = "DELETE FROM books WHERE id=?"; PreparedStatement stmt = conn.prepareStatement(sql); stmt.setInt(1, id); stmt.executeUpdate(); stmt.close(); } } ``` 4. 实体类(Book.java): ```java package com.example.model; public class Book { private int id; private String title; private String author; private String date; public Book() { } public Book(String title, String author, String date) { this.title = title; this.author = author; this.date = date; } public Book(int id, String title, String author, String date) { this.id = id; this.title = title; this.author = author; this.date = date; } // getters and setters } ``` 以上代码仅供参考,具体实现可能会因为需求不同而有所变化。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值