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>
相关推荐
广州华水科技几秒前
大坝安全监测解决方案:单北斗GNSS形变监测系统应用与维护
前端
yivifu1 小时前
中文古籍电子书注释集成
前端·javascript·python·beautifulsoup·epub
weixin_448290251 小时前
书庐开发实战教学
javascript·css·html
默_笙1 小时前
🛴 从散件到整机:DeepAgents 与 Agent 身上预留的那些"插槽"(前置介绍)
前端·javascript
zhangzeyuaaa2 小时前
深入理解 Ruby 运算符:本质、分类、坑点与重载实战
开发语言·前端·ruby
一木 之林2 小时前
DeepSeek Agent 开发(一)
开发语言·前端·javascript
树下水月3 小时前
Typora破解
linux·服务器·前端
用户5508492902563 小时前
CSS布局实战:从Flex到Grid的完整避坑指南
前端
用户5508492902563 小时前
前端接口请求层怎么封装?一个可落地的请求方案
前端
MetWeave4 小时前
跟着一条 SPECI 走流水线:从电报到界面
前端