Online Tutorials & Training Materials | STechies.com
Register Login

Top Latest HTML Interview Questions and Answers

|| 0

Top Latest HTML Interview Questions and Answers
Stechies

What is HTML and what does HTML stand for?

HTML stands for HyperText Markup Language that is used to create the basic structure of the web pages. HTML uses various attributes and tags to determine the behavior of the web pages, like what images to display, the different hyperlinks, for setting basic styles of text and background, etc. It is also used to define how the web page will respond upon user interaction.

What are the main features of HTML?

The essential features of HTML are:

  • It is not a programming language, but a markup language.
  • It is not case sensitive.
  • It can run on any operating system or browser and is platform-independent.
  • Video elements can be implemented in the web pages through the video tag without any third-party plug-in.
  • Web workers allow web applications to perform complicated tasks without affecting the performance of the web pages.
  • The canvas element allows users to modify the images and graphics easily without resorting to technologies like jQuery.

What is the basic fundamental block of an HTML page?

The basic fundamental block of an HTML page is the <html> tag. 

Why HTML is not a true programming language?

HTML is a markup language that defines the basic structure of the web pages and the arrangement of elements. As it does not have any programming logic and lacks logical statements like loops or if-else statements, it cannot be considered a true programming language.

How to comment in HTML?

Comments in HTML are placed by adding the information in between the <!--and -->. All the data in between the comments are not visible in the web page but will be visible to if the source code is viewed.  The following syntax is used for providing comments on a web page:

<!-- You will not be able to see this sample text. -->

How to change the font in HTML?

Fonts in a web page can be changed in HTML using the <style> tag. Inside this tag the font size, font family, font-weight, color etc. features can be altered. The following syntax can be used:

<style>
font-size: 12px;
font-family: Tahoma;
color: red;
</style>

Inline style statements can also be used for example,

<p style= “font-size: 12px; font-family: Tahoma; color: red”;>

What is div in HTML?

The <div> is a very important tag used for creating a division or section in the web page. The div provides a container where other elements can be placed. It helps while styling them with the help of CSS and defining their interactions with the user through Javascript.

For example,

<div style="background-color: seablue">

  <h3>Just a heading</h3>

  <p>And a paragraph</p>

</div>

What is padding in HTML?

Padding defines the area or amount space inside an element. It can be considered as the distance between the content and the border around the element.

How many levels of heading are there in HTML?

There are 6 levels of heading in HTML starting from <h1> to <h6>, where <h1> is the biggest in size and <h6> is the smallest.

What are HTML tags? Name some most commonly used Html tags

HTML tags are a set of codes which is used to define the structure of your webpage such as heading, hyperlink, paragraph etc. Any HTML tag start with < sign and ends with > sign ie <H1>.

Some most commonly used Html tags are:

  • Title Tag <title>: Used to define the title of the webpage
  • Body tag <body>: Used to define the main content of the webpage
  • Head tag <head>: Used to define the headings of web page
  • A tag <a>: To use links
  • P tag <p>: Used to define paragraph
  • Table tag <table>: Define table in webpage
  • <div>, <li>, <ul>, <ol>, <section> etc are some other important Html tags.

Explain the HTML image map?

An image map is a set of coordinates related to an image used in HTML. It is used to hyperlink the different sections within an image to other destinations web sites. It removes the need to create image files. They are used in both the server-side and the client-side. They can be created manually through a text editor. They are defined using the <map> tag.

How to add alternative text for an image in HTML?    

To add an alternate text in HTML in case the original image is not shown properly or is not rendered, the alt attribute is used inside the image tag. The following syntax can be used in this case:

<img src=”home.jpg” alt=”Oops!”>

What is doctype in HTML?        

The <!DOCTYPE> is not a tag but a declaration to the web browser that specifies the version of HTML currently being used in the page. For example, it tells the browser that the page being rendered is in HTML 5. As the element does not have any content, it does not have a closing tag. Every HTML document must start with a <!DOCTYPE> declaration.

What is span in HTML?

The <span> tag is used in HTML to group inline elements and style them. This tag is used along with inline elements like a paragraph or certain portions of it too. For example, it can be used to set a colour different from that of other paragraphs in a document.

For example,

<p> This is a sample text <span style=”color: green”> where some of it is different in colour </span></p>

How to increase button size in HTML?

The size of a button in HTML can be increased modifying the height and width attributes of the button tag. It can be achieved using inline style statements and through external style sheets through CSS.

What is the pre tag in HTML?

The <pre> tag is used to define preformatted text. All the text or information inside a <pre> tag is displayed on the web page just as it is, preserving the line breaks and whitespaces. The text inside a <pre> tag is usually shown in a font like Courier that has fixed width.

What is a placeholder in HTML?

The placeholder is an attribute that is used to provide a hint about the text that can be given in the input field by the user. The attribute is compatible with the input types like search, text, email, password, tel, and URL. For example, if there is an input field called First Name, the textbox will display “John” according to the placeholder value.

The syntax is:

<input type=”text” name=”FirstName” placeholder=”John”>
<input type=”text” name=”LastName” placeholder=”Wick”>

What is a label in HTML?

The <label> in HTML defines a label for elements like <input>, <output>, <button>, <textarea>, <progress>, <select> etc. The for an attribute of the elements have to be equal to their respective id values, to combine them together. The label tag does not display anything on the web page but helps in improving the interactivity with the users while they click on these elements.

What is 'tt' & 'p' tag in html?

The <tt> tag (Teletype Text) is an obsolete tag that is not supported by HTML 5. It was used for rendering the text as it would appear on a fixed width display like a teletype or a line printer.

The <p> is used to display a paragraph.