HTML stands for “Hypertext Markup Language.”
It is the language used to create web pages and give them structure and format.
HTML uses tags to mark different elements on a web page.
Tags are like order or instructions that tell the web browser how to display the content.
HTML Tags always comes in pairs: one is called opening and another is called Closing tag. Tags always enclosed by angel bracket (<>).
Web browsers read the HTML code and display the web page accordingly.
1. Learn HTML and know that you don’t know
What is HTML?
HTML stands for "Hypertext Markup Language."
It is the language used to create web pages and give them structure and format.
HTML uses tags to mark different elements on a web page.
Tags are like order or instructions that tell the web browser how to display the content.
2. HTML Tags always comes in pairs: one is called opening and another is called Closing tag.
Tags always enclosed by angel bracket (<>).
Web browsers read the HTML code and display the web page accordingly.
Basic HTML Structure
Every HTML document starts with the <html> tag and ends with the </html> tag.
The main content of a web page is placed between the <body> and </body> tags.
Headings are used to create different levels of headings, such as <h1>, <h2>, <h3>, and so
on.
Paragraphs are created using the <p> tag.
Links are created using the <a> tag and the href attribute, which specifies the URL of the
linked page.
Working with Images
You can add images to your web page with the help of this <img> tag.
The src attribute is used to specify the source or location of the image file.
Alt attribute provides alternative text for the image, which is displayed if the image cannot be
loaded.
You can resize your Images the width and height attributes.
Creating Lists
Unordered lists are created using the <ul> tag and list items are created using the <li> tag.
Ordered lists are created using the <ol> tag, and list items are also created using the <li>
tag.
Nested lists can be created by placing one list inside another.
Formatting Text
Text can be formatted using different tags, such as <strong> for bold, <em> for italic, and
<u> for underline.
Headings, paragraphs, and other text can be aligned using CSS styles.
3. Adding Basic Styling
CSS (Cascading Style Sheets) is used to add styles and colors to HTML elements.
CSS can be added to an HTML page using the <style> tag or by linking an external CSS file.
Colors can be specified using different color names or hexadecimal codes.
Q.1 What does HTML stand for?
HTML stands for Hypertext Markup Language.
Q 2.What is the purpose of HTML in web development?
HTML is used to create web pages and give them structure and format.
Q 3.What are HTML tags? Give examples of three commonly used HTML tags.
HTML tags are instructions that tell the web browser how to display content.
o Examples of commonly used HTML tags are:
<h1> for heading
<p> for paragraph
<a> for hyperlink
Q.4 How do you create a hyperlink in HTML? Explain with an example.
Hyperlinks are created using the <a> tag in HTML.
o Example: <a href="https://www.example.com">Click here</a>
Q 5.How do you add an image to an HTML page? Explain with the required HTML tags and
attributes.
Images are added using the <img> tag and the src attribute to specify the image source.
o Example: <img src="image.jpg" alt="Description of the image">
Q 6.What is the purpose of the alt attribute in an <img> tag?
4. The alt attribute provides alternative text for the image, which is displayed if the image
cannot be loaded.
Q 7.How do you create a numbered list in HTML? Provide an example.
Numbered lists are created using the <ol> tag, and each list item is created using the <li>
tag.
o Example:
code
<ol> <li>First item</li>
<li>Second item</li>
<li>Third item</li> </ol>
Q 8.Explain what is an opening tag and a closing tag in HTML?
An opening tag is used to start an HTML element, while a closing tag is used to end it.
Q 9.How do you format text as bold in HTML? Provide an example.
Text can be formatted as bold using the <strong> tag.
o Example: <strong>This text is bold</strong>
Q 10.What is the role of CSS in HTML? Briefly explain its purpose and how it is used.
CSS (Cascading Style Sheets) is used to add styles and colors to HTML elements.
It is used to control the appearance of web pages by specifying fonts, colors, layouts, and
more.