html Interview questions and answerS (5)

HTML stands for HyperText Markup language. This means that an HTML document is written in text and can be used to describe the structure and content of webpages. Whether you have acquired knowledge about HTML from an online course or at college the importance of leaving a mark on the interviewer to get a job cannot be denied. If you are a fresher in this field and are looking the interviewer for a job then these are the few questions that target out on you. Answering these questions with confidence can help you in getting your dream job.

Here are the questions that you need to prepare:

  1. What do you understand by the term HTML and why is it used for?

Answer: HTML is an abbreviated form of HyperText Markup Language which is a very commonly used language that gives the webpage a defined structure. It was created by Berners Lee in the year 1991. It is primarily a markup language that is a set of markup tags. Each webpage is created in HTML. The HTML documents so created are described in HTML tags.

  • What does Semantic Markup imply?

Answer: Semantic Markup is the tags that do not alter the structure of a page. But these tags add extra information to the page.

for eg:- <form>, <table>, and article are Semantic Elements. Following is the list of a few new Semantic Elements that are introduced in HTML5

<aside>

<figcaption>

<figure>

<header>

<footer>

<main>

<mark>

<nav>

<section>

<details>  

<summary>

<time>

  • What does Fieldset in HTML imply?

Answer: The <fieldset> is a tag in HTML is implied for group related elements in a form. It draws a box around the elements that are connected.

  • What an image map do in HTML? Why is the alternative text that once can use in image mapping?

Answer: The importance of an image map is to link the different web pages with the help of a single image. This is mainly described by <map> tag. This can be used to define shapes in images that can be a part of an image mapping. While working on the image maps, it can be little complicated and hard to ascertain which hotspots correspond to which link. But, with the usage of alternative texts, you can put a descriptive text on each hotspot link.

  • How many heading tags are there in HTML?

Answer: HTML contains 6 types of headings that can be defines as <h1> to <h6>. Each of the heading tag displays different text size from the other. <h1>is the largest heading tag and <h6>is the smallest one.

  1. h1>Heading no. 1</h1>    
  2. <h2>Heading no. 2</h2>    
  3. <h3>Heading no. 3</h3>    
  4. <h4>Heading no. 4</h4>    
  5. <h5>Heading no. 5</h5>    
  6. <h6>Heading no. 6</h6>
  • What is HTML Text Formating?

Answer: Text formatting in HTML is using the native language tags of HTML (HyperText Markup Language) to change sizes, weight, orientation (italic vs Roman), and tabulation of plain text in documents for a Web browser, software which has the built-in functionality to interpret the mark-up and then display the text as indicated by the mark-up. For example: <p>some text</p> would render a paragraph; <h1>A Headline</h1> would be the largest headline, whereas a tag of <h6> would render the smallest headline. However, it is extremely rare to only use HTML to display text on a Web page these days because the development and use of CSS (Cascading Style Sheets) give the Web designer a powerful tool to apply much more variety in text styling.

  • Do all HTML tags need to have an end tag and do all HTML tags come in pair?

Answer: Some of the HTML tags need not have an end tag, Example <image> tag, <br> tag and few more. No, not all HTML tags need to come in pair some of the HTML tags are there that do not require a closing tag.

  • How can you create a hyperlink in HTML?

Answer: HTML gives an anchor tag to generate a hyperlink that combines one page to another page. you can see the tags displayed in the following ways:

Unvisited link- it is shown as underlined and in blue color.

Visited link – It is shown as underlined and in purple color

Active link – It is sown as underlined and in red color.

  • Which HTML tag is used to display the data in the tabular form?

Answer: To display the data in the tabular form, the HTML Table tag is used. It also manages the layout of the page, like header section, body content, navigation bar, footer section. The list of tags that are used to present the data in tabular form are as follows:

Tag

Description

<table>

Describes a table

<tr>

  1. Describes a row in a table

<th>

Describes header cell in a table

<td>

  • Describes a cell in a table

<caption>

Describes the table caption

<colgroup>

Define a group of one or more columns in a table for formatting.

<col>

Used with <colgroup> element to define column properties for each column

<tbody>

Used group the body content in a table.

<thead>

Used to group the header content in a table

<tfooter>

Used to group the footer content in a table

  1. What are the common lists that can be used while a paper is designed?

Answer: The common lists that are used to design a page are many and they can be used alone or in combination with others. The common lists that used for designing are:

Ordered list – it shows elements in a numbered format. It is represented by <ol> tag.

Unordered list – It shows elements in a bulleted format. It is represented by <ul> tag.

Definition list – It shows elements in definition form similar to in a dictionary. The <dl>, <dt> and <dd> tags are used to define description list.

  1. How do you insert a copyright symbol on a browser page?

Answer: copyright symbol can be inserted with the help of &copy, or &#168, in an HTML file.

  1. Are HTML elements and tags the same?

Answer: No. HTML elements and tags are not the same. HTML elements are to communicate to the browser to render text, the elements are enclosed by <>, they form HTML tags. Normally, the tags come in a pair with surrounded content

  1. How can you add the feature to expand in an HTML file? 

Answer: The easiest way to do this is through JavaScript. In case, you are using Bootstrap Framework then there are components called popover or Accordion.

  1. Does a hyperlink apply to text only?

Answer: Hyperlink can be applied for any text and image. The HTML anchor tag defines a hyperlink that links one page to another page. A hyperlink can be applied to any tag by keeping it between anchor tag. for example,

<a><img></img></a>

this will hyperlink on an image.

The “href: attribute is the most essential attribute of the HTML anchor tag.

  1. Is it possible to change the color of the bullet?

Answer: The bullet’s color is always similar to the text’s color of the list. Therefore to change the color of the bullet the color of the text requires to be changed.

  1. Is multi-colored text possible on a web page?

Answer: yes it is very much possible to create multicolor text on a web page and for this <font color = “color” <>/font> is to be used for the specific text that you desire to color.

  1. Why doesn’t HTML control the layout of a page?

Answer:  Because it is the task of CSS. HTML defines the content, the structure (articles, sections, side boxes, headers, footers, etc.), the semantic. CSS defines the look, the layout (side boxes on left, on right, on both, etc.), the typography and colors, etc.n

  1. What is a marquee in HTML?

Answer: A Marquee is an HTML tag to produce a scrolling effect on the text on a web page. It is used to scroll the image or text up, down, left or right automatically. For this, the text is required to be put within the <marquee>…….</marquee> tag.

  1. How many tags are applied to separate a section of tags?

Answer: There are generally three tags are applied to separate texts.

<br> tag – it is used to separate the line of text. It breaks the current line and conveys the flow to the next line

<p> tag – The <p> tag contains the text in the form of a new paragraph. 

<blockquote> tag – It is used to define a large quoted section. If you have a large quotation, then put the entire text within <blockquote>………….</blockquote> tag.

  • Why is a URL encoded in HTML?

Answer: An URL is encoded to convert non-ASCII characters into a format that can be used over the Internet because a URL is sent over the Internet by using the ASCII character-set only. If a URL has any type of characters that are outside the ASCII set, in that case, URL will need to be replaced. The non-ASCII characters are replaced with a “%” followed by hexadecimal digits.

  • What is the benefit of iframe tag?

Answer: An iframe is utilized to show a web page in a web page that lies within it.

Syntax: <iframesrc+”URL” ></ iframe>

  • What does the style sheet mean?

Answer:  It specifies how HTML elements would be shown on screen, paper, or in any other type of media. It can efficiently manage the layout of several web pages at one time.

You can add HTML elements in 3 ways:

  • Inline – by using the style attribute in HTML elements
    • Internal – by using a <style> element in the <head> section
    • External – by using an external CSS file

The most common way to add it is to keep the styles in separate CSS files. so far it is the only markup language we can style our web with.

  • In new browser do the old HTML files continue to work?

Answer: yes the older HTML files are compliant and compatible to HTML standard. Most of the older files work on the new browser however a few of the features may not work.

  • What is the primary benefit of collapsing white space?

Answer: White spaces are the blank sequence of space character that can be treated as a single space character in HTML. The browser then collapse numerous spaces in a single space which can aid indent lines of text, This helps in organizing the HTML code in a much user-friendly and readable format

  • What is mean by entities in HTML?

Answer: HTML character entities are applied in place of reserved characters in HTML. They can be used to substitute characters that are not present on the keyboard by entities. The characters need to be substituted as some of the characters are reserved in HTML.

  • How do you change the number type in the middle of a list?

Answer:  By using < li > tag, the type attribute can be used to modify the numbering style for any list item.

For Eg :

<ol>

<li value=”30″> makes this list item number 30.</li>

<li value=”40″> makes this list item number 40.</li>

<li> makes this list item number 41.</li>

</ol>

  • what hierarchy is used when in style sheets?

Answer: the hierarchy of style sheet is as follows:

  • Inline style precedes over embedded style sheet
    • Embedded style sheet precedes over an external style sheet.
    • If there is a single selector that has all the three different style definitions the definition that is nearest to the actual tag will get the priority.
  • Do the frames have any benefit?

Answer: frames have much of importance; they help in easy navigation within the site. The links appear in the frame throughout the site and it helps in using them with ease.

  • Is it possible to hide a source?

Answer: it is not possible to hide the source as it is required by the browser dor the display of the document.

  • Is it possible to align a table to left or right?

Answer: Yes this can be done with the help of the following:

To align the table to the right use <TABLE ALIGN =” RIGHT”>

To align the table to the left use <TABLE ALIGN =” LEFT”> 

  • What do you mean by session storage, local storage, and Cookies? 

Answer: Cookies are small text files that websites place in a browser for tracking or login purposes. Meanwhile, local storage and session storage are new objects, both of which are storage specifications but vary in scope and duration. Of the two, localStorage is permanent and website-specific whereas sessionStorage only lasts as long as the duration of the longest open tab.

Cookies are used for server-side reading or client’s side reading. localStorage and sessionStorage can also be used to read on client-side.

  • What is the difference between border and rule attributes?

Answer:  In case border attribute is set to a nonzero value then efault cell borders, having width of 1 pixel, are inserted automatically in between cells. Similarly, In case of the border attribute is not incorporated, a 1-pixel border by default appears.

  • What do you understand by empty element?

Answer: HTML element without content are known as empty elements, for eg:- <br>, <hr> etc.

  • What are the different new form element types in HTML 5?

Answer: Following is a list of 10 frequently used new elements in HTML 5:

Color

Date

Datetime-local

Email

Time

Url

Range

Telephone

Number

Search

  • What happens if you open the external CSS file in a browser?

Answer:  Firstly, it won’t allow you to open with a different extension. The only way to open is by providing it reference by <link/> tag inside another HTML doc.

  • How active links differ from normal links?

Answer: Normal links are links which are there on the page and have not been clicked yet. Active links are those links, which have just been clicked at that instant.

  • Is it possible to use someone else’s Style Sheet without permission?

Answer: this issue is very unclear. In HTML tags, style sheet information is specified with unique language syntax. It doesn’t fall under a copyright issue in case of use of language. Furthermore, the syntax doesn’t transmit any kind of content. It only deliver information.

It may not be a good idea to refer to an external style sheet on another person’s server. If you are doing so, it would be similar to referencing an in-line image from another person’s server in your HTML doc. It can overload a server if all pages on the net refer to the same entry. You can contact the creator of the style sheet, and discuss using it if possible. But in most cases, you won’t get the permission or get to discuss with the style sheet creator. Whatever the case may be, as an alternative, one should create a local copy and use it.

LEAVE A REPLY

Please enter your comment!
Please enter your name here