
| `<p> This is a paragraph. </p>`. |
| Block Elements Examples | |
| Block Elements | Their Uses |
| <div> | It is used for grouping HTML elements together for layout purposes. |
| <P> | Represents a paragraph. |
| <h1> - <h6> | Used for creating the headings, with `<h1>` being the most important and `<h6>` being the least. |
| Examples Of Inline Elements | |
| HTML Elements | Uses |
| <span> | Used for styling a specific part of text. |
| <a> | Used to create hyperlinks that allow users to navigate to other pages. |
| <strong> | Makes text bold, indicating strong emphasis. |
| Examples Of Void Elements | |
| HTML Void Element | Their Uses |
| <img> | Used to embed images on a webpage. |
| <br> | It Inserts a line break, forcing the content after it to start on a new line. |
| <input> | Used to create interactive fields in forms, like text boxes or buttons. |
| <a href="https://www.pwskills.com">Visit pwskills.com!</a> |
| <img src="image. jpg" alt="Description Of an Image"> |
| Example Of Table Tag |
| <table> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>₹100</td> </tr> </table> |
| HTML Attributes Example | ||
| Attribute | Description | Example |
| id | Provides a unique identifier for an element. | <div id="header"></div> |
| class | Assigns one or more class names to an element, which can be used for better readability. | <p class="intro"></p> |
| src | Specifies the source URL for an image, video, or script. | <img src="image.jpg"> |
| href | Sets the destination URL for a link. | <a href="https://example.com">Click here</a> |
| alt | Provides alternative text for an image if it cannot be displayed. | <img src="image.jpg" alt="Description"> |
| title | Adds a small descriptive text that appears when the user hovers over the element. | <a title="Go to homepage">Home</a> |
| style | Applies inline CSS styles directly to an element. | <p style="color:blue;">Hello</p> |
| type | Defines the type of an input element in forms, such as text, password, or submit. | <input type="text"> |
| value | Sets the initial value for an input element. | <input type="text" value="Name"> |
| disabled | Disables an element so it cannot be interacted with by the user. | <button disabled>Submit</button> |
| HTML Elements Example |
| <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>HTML Elements Example</title> <style> body { font-family: Arial, sans-serif; margin: 20px; } header, footer { background-color: #f4f4f4; padding: 10px; text-align: center; } section { margin: 20px 0; } img { max-width: 100%; height: auto; } </style> </head> <body> <header> <h1>Welcome to PW Skills</h1> </header> <nav> <ul> <li><a href= “Full Stack Developer Courses”>Full Stack Developer Courses</a></li> <li><a href="Programming Courses">Programming courses</a></li> <li><a href="UI/UX Courses">UI/UX Designer Courses</a></li> </ul> </nav> <section id="section1"> <h2>Section 1: Text Elements</h2> <p>PW Skills is India’s largest ed-tech platform providing various technical and non-tech courses to upskills your career. </p> <blockquote> Start your Journey With PW Skills Today. </blockquote> </section> <section id="section2"> <h2>Section 2: List Elements</h2> <ul> <li>Job Assistance Courses</li> <li>Free Courses</li> <li>Career Upskilling Courses</li> </ul> </section> <section id="section3"> <h2>Section 3: Media and Forms</h2> <img src="https://PWskills.com" alt="Skills image"> <form action="/submit" method="post"> <label for="name">Name:</label> <input type="text" id="name" name="name" placeholder="Enter your name" required> <label for="email">Email:</label> <input type="email" id="email" name="email" placeholder="Enter your email" required> <label for="message">Message:</label> <textarea id="message" name="message" rows="4" placeholder="Enter your message"></textarea> <button type="submit">Submit</button> </form> </section> <footer> <p>Copyrighit To PW Skills 2024</p> </footer> </body> </html> |
Output-
![]() |