HTML Questions
Warm up for HTML questions with most asked questions and answers for junior, mid, and senior roles.
What is the use of an iframe tag?
Show AnswerHide Answer
What are the entities in HTML?
Show AnswerHide Answer
An HTML entity is a piece of text ("string") that begins with an ampersand (&) and ends with a semicolon (;).
Entities are frequently used to display reserved characters (which would otherwise be interpreted as HTML code), and invisible characters (like non-breaking spaces).
You can also use them in place of other characters that are difficult to type with a standard keyboard.
What is the canvas element in HTML5?
Show AnswerHide Answer
The canvas element is used to draw graphics, images, and other visual elements on the web page.
Do all HTML tags have an end tag?
Show AnswerHide Answer
No, in HTML5 there are 14 tags without ending tag for example:
Which type of video formats are supported by HTML5?
Show AnswerHide Answer
HTML5 supports the following video formats:
- mp4
- WebM
- Ogg
What are the limits of the text field size?
Show AnswerHide Answer
The default size for a text field is around 13 characters. However, if you include the size attribute, you can set the size value to be as low as 1. The maximum size value will be determined by the browser width.
What is the relationship between the border and rule attributes?
Show AnswerHide Answer
The border attribute is used to set the width of the border.
The rule attribute is used to set the style of the border.
What is Cell Spacing and Cell Padding?
Show AnswerHide Answer
Cell spacing is used to set the space between cells.
Cell padding is used to set the space between the cell content and the cell border.
How many types of CSS can be included in HTML?
Show AnswerHide Answer
There are two types of CSS: inline and external.
What are some common lists that are used when designing a page?
Show AnswerHide Answer
There are 3 types of lists in HTML:
What is the difference between HTML elements and tags?
Show AnswerHide Answer
HTML elements are the actual pieces of content that are displayed on the web page.
Tags are used to create HTML elements.
Difference between link tag <link> and anchor tag <a>?
Show AnswerHide Answer
The link tag is used to link to an external file.
The anchor tag is used to link to a page within the same HTML document.
In how many ways can we position an HTML element?
Show AnswerHide Answer
There are four ways to position an HTML element.
1. Absolute Positioning
2. Relative Positioning
3. Fixed Positioning
4. Static Positioning
In HTML, does a hyperlink only apply to text?
Show AnswerHide Answer
No, a hyperlink applies to both text and images.
Explain the layout of HTML?
Show AnswerHide Answer
The layout of an HTML file is the way the content is displayed on the web page, it is a blueprint used to arrange web pages in a well-defined manner.
When are comments used in HTML?
Show AnswerHide Answer
Comments are used to add extra information to HTML elements.
You can use it using the tag.
What is a style sheet?
Show AnswerHide Answer
A style sheet is a file that contains CSS or other form of styling code.
What is a marquee?
Show AnswerHide Answer
An HTML marquee is a scrolling piece of text displayed either horizontally across or vertically down your webpage depending on the settings.
What is the difference between div and span in HTML?
Show AnswerHide Answer
Why is a URL encoded in HTML?
Show AnswerHide Answer
URL is encoded into a format that can be transmitted over the Internet.
What are empty elements?
Show AnswerHide Answer
Empty elements are elements that have no content.
For example:
What is the use of a span tag?
Show AnswerHide Answer
tag is used as a generic container of inline elements. It is used for styling purpose to the grouped inline elements (using class and id attribute or inline style).
What is SVG?
Show AnswerHide Answer
SVG is a language for describing scalable vector graphics.