HTML Q & A 1
HTML Q & A 1
HTML stands for HyperText Markup Language and is the language of the
internet. It is the standard text formatting language used for creating and
displaying pages on the Internet
HTML documents are made up of the elements and the tags that format it for
proper display on pages.
2. What are HTML tags?
We use HTML tags for placing the elements in the proper and appropriate
format. Tags use the symbols <, and > to set them apart from the HTML
content.
The HTML tags need not be closed always. For example, in the case of images,
the closing tags are not required as <img> tag.
3. What are HTML Attributes?
Attributes are the properties that can be added to an HTML tag. These
attributes change the way the tag behaves or is displayed. For example, a
<img> tag has an src attribute, which you use to add the source from which
the image should be displayed.
We add attributes right after the name of the HTML tag, inside the brackets.
We can only add the attributes to opening or self-closing tags, but never be in
closing tags.
4. What is a marquee in HTML?
Marquee is used for scrolling text on a web page. It scrolls the image or text
up, down, left, or right automatically. To apply for a marquee, you have to use
</marquee> tags.
5. How do you separate a section of texts in HTML?
We separate a section of texts in HTML using the below tags:
• <br> tag – It is used to separate the line of text. It breaks the current
line and shifts the flow of the text to a new line.
• <p> tag–This tag is used to write a paragraph of text.
• <blockquote> tag–This tag is used to define large quoted sections.
6. Define the list types in HTML?
The list types in HTML are as below:
• Ordered list–The ordered list uses <ol> tag and displays elements in a
numbered format.
• Unordered list–The unordered list uses <ul> tag and displays elements
in a bulleted format.
• Definition list–The definition list uses <dl>, <dt>, <dd> tags and displays
elements in definition form like in a dictionary.
7. How do you align list elements in an HTML file?
We can align the list elements in an HTML file by using indents. If you indent
each nested list in further than the parent list, you can easily align and
determine the various lists and the elements that it contains.
8. Differentiate between an Ordered list and an Unordered list?
An unordered list uses <ul> </ul> tags and each element of the list is written
between <li> </li> tags. The list items are displayed as bullets rather than
numbers.
An ordered list uses <ol> </ol> tags and each element of the list is written
between <li> </li> tags. The list items are displayed as numbers rather than
bullet points.
<!DOCTYPE html>
<html>
<body>
<h2>HTML List Example</h2>
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Tag Description
16. How would you display the given table on an HTML webpage?
5 pcs 10 5
1 pcs 50 5