HTML 实操试题(一)

  1. 创建一个包含标题、段落和链接的基本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>
  2. 创建一个无序列表和有序列表:

    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>
  3. 创建一个表格展示学生信息:

    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>
  4. 使用表单元素创建一个简单的登录表单:

    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>
  5. 嵌套使用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>&copy; 2023 My Website</p>
    </div>
相关推荐
We་ct40 分钟前
LeetCode 5. 最长回文子串:DP + 中心扩展
前端·javascript·算法·leetcode·typescript
陈随易4 小时前
有生之年系列,Nodejs进程管理pm2 v7.0发布
前端·后端·程序员
冰暮流星5 小时前
javascript之事件代理/事件委托
前端
陈随易6 小时前
AI时代,你还在坚持手搓文章吗
前端·后端·程序员
里欧跑得慢8 小时前
17. Flutter Hero动画实现:让界面过渡更加优雅
前端·css·flutter·web
IT_陈寒9 小时前
Vue的这个响应式陷阱,我debug了一整天才爬出来
前端·人工智能·后端
cn_mengbei9 小时前
用React Native开发OpenHarmony应用:Reanimated共享元素过渡
javascript·react native·react.js
kyriewen9 小时前
前端测试:别为了100%覆盖率而写测试,那是自欺欺人
前端·javascript·单元测试
去伪存真9 小时前
我自己写的第一个skills--project-core-standards
前端·agent
Data_Journal9 小时前
如何使用cURL更改User Agent
大数据·服务器·前端·javascript·数据库