HTML 实操试题(一)

2023-12-25 13:01:40

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

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

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

    <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元素创建一个基本页面布局:

    <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>
    

文章来源:https://blog.csdn.net/weixin_59383576/article/details/135195773
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。