-
创建一个包含标题、段落和链接的基本HTML文档:
html<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>HTML Practice</title> </head> <body> <h1>Welcome to My Website</h1> <p>This is a sample paragraph. <a href="https://www.example.com">Visit our website</a>.</p> </body> </html> -
创建一个无序列表和有序列表:
html<ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> <ol> <li>First</li> <li>Second</li> <li>Third</li> </ol> -
创建一个表格展示学生信息:
html<table border="1"> <thead> <tr> <th>Name</th> <th>Age</th> <th>Grade</th> </tr> </thead> <tbody> <tr> <td>John Doe</td> <td>20</td> <td>A</td> </tr> <tr> <td>Jane Smith</td> <td>22</td> <td>B</td> </tr> </tbody> </table> -
使用表单元素创建一个简单的登录表单:
html<form> <label for="username">Username:</label> <input type="text" id="username" name="username" required> <label for="password">Password:</label> <input type="password" id="password" name="password" required> <input type="submit" value="Login"> </form> -
嵌套使用div元素创建一个基本页面布局:
html<div class="header"> <h2>My Website</h2> </div> <div class="nav"> <ul> <li>Home</li> <li>About</li> <li>Contact</li> </ul> </div> <div class="content"> <p>This is the main content of the page.</p> </div> <div class="footer"> <p>© 2023 My Website</p> </div>
HTML 实操试题(一)
知孤云出岫2023-12-28 14:33
相关推荐
sunywz8 小时前
【c#】 Web Deploy一键发布,IIS部署全流程宁&沉沦8 小时前
Chrome 扩展 Manifest 字段版本支持一览(全量)乖孩子8 小时前
Service Worker + IndexedDB 实践浮生望8 小时前
BFF架构实战:用Express+SSE为Vue3搭建安全的流式对话中间层Quz8 小时前
QML 与 JavaScript 交互方式:内联函数、外部文件、信号槽与工作线程先吃饱再说9 小时前
React 组件通信:从 Props 单向传递到自定义事件swipe9 小时前
05|(前端转后全栈)不手写一堆 SQL,后端怎么操作数据库?MyBatis-Plus 入门Allshadow9 小时前
Nest.js - 连接数据库冰暮流星9 小时前
javascript之date对象swipe9 小时前
04|(前端转后全栈)前端状态为什么不够用?从页面数据到 MySQL 持久化