Learn HTML - Dasun Nilanjana

Welcome to HTML Basics

1. Basic Structure of HTML

HTML, which stands for HyperText Markup Language, is the standard markup language for creating web pages. The basic structure of an HTML document includes the following elements:

            <!DOCTYPE html>
            <html lang="en">
            <head>
                <meta charset="UTF-8">
                <meta name="viewport" content="width=device-width, initial-scale=1.0">
                <title>Your Page Title</title>
            </head>
            <body>
                
            </body>
            </html>
        

2. Basic Text Formatting Tags

HTML provides various tags for text formatting. For example, use <strong> for bold text and <em> for italic text:

            <p>This is a <strong>bold</strong> and <em>italic</em> text.</p>
        

3. HTML Lists

Unordered list using <ul> and <li>:

            <ul>
                <li>Item 1</li>
                <li>Item 2</li>
                <li>Item 3</li>
            </ul>
        

Ordered list using <ol> and <li>:

            <ol>
                <li>First</li>
                <li>Second</li>
                <li>Third</li>
            </ol>
        

4. HTML Tables

Create a table using <table>, <tr> for rows, <th> for headers, and <td> for data:

            <table border="1">
                <tr>
                    <th>Header 1</th>
                    <th>Header 2</th>
                </tr>
                <tr>
                    <td>Row 1, Cell 1</td>
                    <td>Row 1, Cell 2</td>
                </tr>
                <tr>
                    <td>Row 2, Cell 1</td>
                    <td>Row 2, Cell 2</td>
                </tr>
            </table>
        

5. HTML Links

Create a link using the <a> tag with the href attribute:

            <a href="https://www.example.com">Visit Example.com</a>
        

Learn more about HTML and web development to unlock endless possibilities!

Comments

Popular posts from this blog

html basics

vidun