Short Notes 2- Class 10- Computer Science-Chapter 2- HTML
HTML Forms:
Allows users to input data through various form elements like textboxes, radio buttons, checkboxes, passwords, lists, comboboxes.
Embed audio and video:
<audio>: Embeds audio content in an HTML document.
<video>: Embeds video content in an HTML document.
Example Coding:
<!DOCTYPE html> <html> <head> <title>Form Example</title> </head> <body> <form> <label for=”name”>Name:</label> <input type=”text” id=”name” name=”name”><br><br> <label for=”email”>Email:</label> <input type=”email” id=”email” name=”email”><br><br> <input type=”submit” value=”Submit”> </form> </body> </html> |
Create a table:
<table>, <tr>, <th>, <td>: Used to create tables with rows and columns.
Attributes like rowspan and colspan allow cells to span multiple rows or columns.
Example Coding:
<!DOCTYPE html> <html> <head> <title>Table Example</title> </head> <body> <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> </body> </html> |
Links:
Anchor element <a>: Used for linking to other web pages or resources with attributes like href (URL) and mailto (email link).
Targets can be specified to define where the linked content should open (e.g., _blank for opening in a new tab).
Example Coding:
<!DOCTYPE html> <html> <head> <title>Link Example</title> </head> <body> <a href=”https://www.example.com”>Visit Example Website</a><br><br> <a href=”mailto:info@example.com”>Email Us</a> </body> </html> |
Cascading style sheets (CSS):
CSS is used for styling HTML elements.
Properties like color, background-color, border-style, margin, height, width, outline, font-family, font-style, font-size, text-align, float can be used to style elements.
Example Coding:
<!DOCTYPE html> <html> <head> <title>CSS Example</title> <style> body { background-color: lightgray; font-family: Arial, sans-serif; } h1 { color: blue; } p { font-style: italic; } </style> </head> <body> <h1>Welcome to My Website</h1> <p>This is a paragraph with some styled text.</p> </body> </html> |