HTML Experiments 1-6 PDF

Summary

This document provides a collection of experiments in HTML, covering topics such as basic HTML structure, heading tags, paragraph tags, formatting text, anchor tags, lists, and image tags. The document includes code examples and explanations for each experiment.

Full Transcript

Experiment 1: Basic Structure of an HTML Document Task: Create a basic HTML document that includes the following elements: , , , , and. Objective: Understand the basic structure of an HTML document. Code: Explanation: defines the document type. is the root element. contai...

Experiment 1: Basic Structure of an HTML Document Task: Create a basic HTML document that includes the following elements: , , , , and. Objective: Understand the basic structure of an HTML document. Code: Explanation: defines the document type. is the root element. contains metadata and defines the page title. contains the visible content. Experiment 2: Paragraph and Heading Tags Task: Use heading tags ( to ) and paragraph tags () to create a document with different heading sizes and multiple paragraphs. Objective: Learn how to structure content using headings and paragraphs. Code: Explanation: Heading tags define the importance, with being the most important and the least. is used for creating paragraphs. Experiment 3: Formatting Text with HTML Task: Create an HTML document using tags like , , , , and to format text. Objective: Learn how to format text using various HTML tags. Code: Explanation: and make text bold. and italicize the text. underlines the text. Experiment 4: Anchor Tag and Links Task: Create links using the tag to navigate to external websites and other sections of the same page. Objective: Learn to create hyperlinks using the anchor tag. Code: Explanation: The tag creates hyperlinks. The href attribute defines the link destination. The target="_blank" opens the link in a new tab. You can link to sections within the same page using the id attribute. Experiment 5: Lists in HTML Task: Create an ordered list and an unordered list of items in HTML. Objective: Understand how to create lists in HTML. Code: Explanation: creates an ordered (numbered) list. creates an unordered (bulleted) list. defines a list item. Experiment 6: Image Tag and Attributes Task: Add an image to your webpage using the tag and apply different attributes like alt, width, and height. Objective: Understand how to embed images and use image-related attributes. Code: Explanation: The tag is used to embed images. The alt attribute provides alternative text if the image fails to load. width and height define the size of the image.

Use Quizgecko on...
Browser
Browser