HTML Programs Assignment Practice
1. Basic HTML Structure
This program sets up the basic structure of any HTML document.
Explanation:
<!DOCTYPE html>
: Declares the document type.<html>
: The root element.<head>
: Contains metadata and the title of the document.<body>
: Contains the visible content of the web page.
2. Using Headings and Paragraphs
This program demonstrates headings and paragraphs.
Explanation:
<h1>...<h6>
: Represent headings of different levels (largest to smallest).<p>
: Defines a paragraph.
3. Creating Links
This program shows how to create hyperlinks.
Explanation:
<a href="URL">
: Creates a hyperlink. Thehref
attribute specifies the link's destination.
4. Adding Images
This program demonstrates embedding an image.
Explanation:
<img>
: Embeds an image.src
: Specifies the image's path.alt
: Provides alternative text if the image cannot be displayed.width
: Sets the image's width.
5. Creating Lists
This program creates ordered and unordered lists.
Explanation:
<ol>
: Ordered list (numbered).<ul>
: Unordered list (bulleted).<li>
: List item.
6. Table Creation
This program creates a simple table.
Explanation:
<table>
: Creates a table.<tr>
: Table row.<th>
: Table header.<td>
: Table data cell.
7. Adding Forms
This program demonstrates an HTML form.
Explanation:
<form>
: Creates a form.<input>
: Takes user input.<button>
: Adds a clickable button.
8. Using Inline CSS
This program shows how to style elements inline.
Explanation:
style
: Applies CSS styles directly to an HTML element.
9. Embedding Videos
This program embeds a video.
Explanation:
<video>
: Embeds a video.controls
: Adds play, pause, and other controls.
10. Using Iframes
This program demonstrates embedding another webpage using an iframe.
Explanation:
<iframe>
: Embeds another webpage.src
: Specifies the source URL.
Comments
Post a Comment