Google News
logo
HTML Interview Questions
HTML stands for Hypertext Markup Language. It is a language of World Wide Web. The first web page was created at CERN by Tim Berners-Lee on August 6, 1991. You can visit and browse the first website and first web page at the http://info.cern.ch/ address.
HTML has many versions since it inceptions during 1990’s. HTML version are HTML, HTML+, HTML 2.0, HTML 3.2, HTML 4.0 and the latest version HTML5.
In HTML, Tag notify the browser that this can be a HTML document. Tag consider all other HTML elements.

<                             =    Open delimeter
>                             =    Closing delimeter
<html>                     =    Opening tag
</html>                   =    closing tag
<html>...</html>    =    Paired tag
<br>                         =    Break tag
<hr>                         =    horizontal Line
<img>                  =    Image Tag 
<html>                     =    Opening tag
</html>                   =    Closing tag
<p></p>                   =    Paragraph Tag
<h1>..-<h6>             =    Heading Tags
An HTML element is everything from starting to the ending of HTML tags. For example, <p> This is an HTML Element</p>, in this example, from starting tag to ending tag everything is HTML element and “This is an HTML Element” is Element Content.
HTML attribute adds additional information to the HTML Elements. For example, <font size=”5” color=”blue”>, here size and color are html attributes.
Hyperlinks are used to navigate to new document with the help of text, links, image or with group of words. Ex : <a href="http://www.freetimelearning.com"> FTL </a>.
WWW stands for World Wide Web. It is the inter-connection of all the links called as internet.
There are many common lists which are used to design a page.

Ordered list
Unordered list
Menu list
Directory list
Definition list
Image map facilitates you link many different web pages using a single image. You can define shapes in images that you want to make part of an image mapping.
Yes. To create a multicolor text on a web page you can use <font color ="blue"> </font> for the specific texts you want to color.
Marquee is used to put the scrolling text on a web page. You should put the text which you want to scroll within the <marquee>......</marquee> tag.
Style sheets enable you to build consistent, transportable, and well-defined style templates. These templates can be linked to several different web pages, making it easy to maintain and change the look and feel of all the web pages within a site.
With ordered lists, you can select to use a number of different list types including alphabetical and Roman numerals. The type attribute for un ordered lists can be set to disc, square, or circle.
The numerical values are taken from the ASCII values for the various characters, but these can be difficult to remember. Because of this, named character entity values were created to make it easier for web page designers to use.
HTML elements with no content are called empty elements. For example: <br>, <hr> etc.
The span tag is used for following :

.  For adding color on text
.  For adding background on text
.  Highlight any color text etc.

Example:

<h3><span style="color:#0099da; font-weight:bold;">  
Free Time Learning

</span></h3>
To open a link in new tab or window, we have to use the following html code :

<a href="http://www.freestimelearning.com" target="_blank"> Welcome to freetimelearning.com  ...! </a>.
Domain Name   :    Ex: www.google.com(is the doamin name here)
Domain Space   :   The space required to place our file or website on the world wide web is called Domain Space.
Browser              :   The Software are the application used to browse the html files is called browser. Ex : Internet Explorer, Mozilla filefox,Google Chrome, Opera, Safari, Netscape Naviagator,Tetra, Epic (First Indian Browser developed at banglore & powered by Mozilla firefox Ex: Epic Browser – Indian Web Browser Epic).
HTML elements with no content are called empty elements. For example: <br>, <hr> etc.
The back ground color of HTML can be change attribute bgcolor in the <body> tag.

Example : 

<html>
  <body bgcolor="#FF00FF">
    <h1>Welcome to FreshersEmploy.com</h1>
    <p>Hello Job Seekers<p>
  </body>
</html>
HTML blocks can be defined by HTML tags like <span> and <div>.
HTML frames can be created by using <frame> tag within a frameset(<frameset>). HTML <frame> tag defines a particular window within frameset.
Semantic HTML is a coding style where the tags embody what the text is meant to convey. In Semantic HTML, tags like for bold, and for italic should not be used, reason being they just represent formatting, and provide no indication of meaning or structure. The semantically correct thing to do is use and . These tags will have the same bold and italic effects, while demonstrating meaning and structure (emphasis in this case).
To insert the copyright symbol, you need to type &copy; or & #169; in an HTML file.
If you go and have a look at HTML markup for any webpage today, you will let to know that HTML elements are contained within other HTML elements. These elements which are inside of other are known as nested elements and they had become the essential part of building any web page nowadays. The most expertise way to know more about nesting is just to think about HTML tags in the form of boxes that hold your content which can be in form of text, images,etc.HTML tags are basically the boxes around the content.
The cellspacing attribute defines the width of the border, while cellpadding represents the distance between cell borders and the content within a cell.
Example:
 
<table border cellspacing=3>
<table border cellpadding=3>
<table border cellspacing=3 cellpadding=3>
Multipart form-data is one of the values of the enctype attribute, which is used in the form element that has a file upload. Multi-part means form data divides into multiple parts and send to the server. It adds a few bytes of boundary overhead to the message, and must spend some time calculating it, but sends each byte in one byte.
In HTML, we have two types of lists unordered lists and ordered lists. Unordered list starts with <ul> tag and ends with </ul> tag. Ordered tag starts with <ol> and ends with </ol>. Each list item is written as <li></li>
An unordered list (<ul>) is used to create a bulleted list in HTML. Below is a simple example to create bulleted list in HTML.
 
<p>Fruits List</p>
<ul>
   <li>Apple</li>
   <li>Banana</li>
   <li>Mango</li>
</ul>
The difference between span and <div> is that a <span> element is in-line and usually used for a small chunk of HTML inside a line,such as inside a paragraph. Whereas, a div or division element is block-line which is equivalent to having a line-break before and after it and used to group larger chunks of code.
 
Example:
<div id="HTML">
	These are HTML<span class="blue_color">Interview Questions</span>
</div>
Yes, we can create a multi-colored text on a web page.  To create a multicolor text, you can use <font color =”color”> </font> for the specific texts that you want to color.
The span tag is used for following things:
 
For adding color on text
To add background on text
Highlight any color text

Example:
<span style="color:#ff00da;">
  This is sample testing text
</span>
 
The default color for normal and active links is blue. Some browsers recognize an active link when the mouse cursor is placed over that link. Whereas, others recognize active links when the link has the focus. Those that don’t have a mouse cursor over that link is considered a normal link.
The <br> tag is one way to separate the lines of text. There are other tags like the <p> tag and <blockquote> tag that are also used to separate sections of text.
The checkboxes don’t affect one another. But, grouping these checkboxes together help to organize them. Checkbox buttons can have their name and do not need to belong to a group. A single web page can have many different groups of checkboxes.
Default cell borders, with a thickness of 1 pixel, are automatically added between cells if the border attribute is set to a nonzero value. Similarly, If the border attribute is not included, a default 1-pixel border appears when the rules attribute is added to the <table> tag.
HTML supports a wide range of media formats for sound, music, videos, movies, and animations. Some of the extensions supported by each media format are:
 
Images : png, jpg, jpeg, gif, apng, svg, bmp, BMP ico, png ico
Audio : MIDI, RealAudio, WMA, AAC, WAV, Ogg, MP3, MP4
Video : MPEG, AVI, WMV, QuickTime, RealVideo, Flash, Ogg, WebM, MPEG-4 or MP4
Logical tags : Logical tags are used to tell the meaning of the enclosed text. The example of the logical tag is <strong> </strong> tag. When we enclose the text in the strong tag, it tells the browser that enclosed text is more important than other texts.
 
Physical tags : Physical tags are used to tell the browser how to display the text enclosed in the physical tag. Some of the examples of physical tags are <b>, <big>, <i>.
The primary function of these lists is to make use of different kinds of tags that could be set to compose.
In some cases, the browser running does not support the character, and thus the character is displayed as boxes. This is the condition in which the character entities do not display correctly on all the systems.
White space is the empty sequence of space characters. This white space is considered as a single space character in the HTML.
White space helps the browser to collapse multiple spaces into one single space, and thereby the indent lines of the text can be taken care of without caring for the multiple spaces that are left. Thereby using the HTML code, white space helps in better organizing the content and tags, making them readable and easy to understand.
We can create several links to different sections within the same web page by using the <a> tag along with referencing through the use of the # symbol.
 Of course, the HTML files could work very well on the new browser, just that the new browser is compliant to the HTML standards. It may be possible that some new browsers may not support the features of HTML and therefore, won’t work well.
The numerical values are taken from the ASCII values for the various characters in the HTML.
An overlapping set of tags in the HTML results in the recognition of only the first tag. Such issues occur only when the text does not display on the browser screen.
Yes, the style sheet can apply tables to position text and images for aligning them accordingly.
Yes, there is a limit of 13 characters in a text field size. By setting the size attribute, the size value can be set as low as 1.
By default, the text cannot appear outside the browser, but, in case the text is part of a table cell with a predefined width, it could extend beyond the browser window.
Representing a webpage inside of another webpage is a nested webpage. It is done using the iframe tag which creates an inline frame. 
 
<html>    
 <body>   
  <h2>HTML Iframes example</h2>    
  <p>Use the height and width attributes to specify the size of the iframe:</p>    
  <iframe src="https://freetimelearning.com/" height="400" width="600"></iframe>    
 </body>    
</html>   
Button tag lets you create a clickable button in the HTML form on the webpage. 
 
<html>    
 <body>    
  <h2>HTML Button Tag Example</h2>    
  <button name="button" type="button">CLICK HERE</button>
 </body>    
</html>
Script tag can be inside the head or body tag of the HTML code. This tag is executed when the browser reaches that part of the document.
  
<html>    
      <body>    
        <h2>HTML Script Tag Example</h2>    
        <script>
           var x = 5;
           var y = 6;
           var result = x + y;
         alert("X + Y is equal to " + result);                                                                                  
        </script> 
      </body>    
</html>
Embed Tag is used for including a Video or an Audio within an HTML Document. The Embed Tag requires a Closing Tag. It requires the Source of the Video or the Audio file that needs to be displayed onto the Page.

Syntax: <EMBED> Source File </EMBED>
Document Style Semantics and Specification Language is an international standard, an expression language, a styling language for associating processing (formatting and transformation) with SGML documents, for example XML.
Double or single quotes in URLs are optional. The tree following examples are equally valid:
 
body {background: url(imgs/ftl_logo.png) blue}
body {background: url("imgs/ftl_logo.png") blue}
body {background: url('imgs/ftl_logo.png') blue}
It is relative to the parent element's font-size. For example, if the style sheet says:
 
H1 {font-size: 20pt;}
SUP {font-size: 80%;}
Yes. If more than one declaration is attached to a selector they must appear in a semi colon separated list, e.g.;
 
Selector {declaration1; declaration2}
P {background: white; color: black}
echnically, since HTML is an SGML application, HTML uses SGML comment syntax. However, the full syntax is complex, and browsers don't support it in its entirety anyway. Therefore, use the following simplified rule to create HTML comments that both have valid syntax and work in browsers:
 
An HTML comment begins with "<!--", ends with "-->", and does not contain "--" or ">" anywhere in the comment. 
The following are examples of HTML comments:
 
* <!-- This is a comment. -->
* <!-- This is another comment,
and it continues onto a second line. -->
* <!---->
HTML has no mechanism to control this. However, with CSS, you can set the margin-bottom of the form to 0.

For example : 
<form style="margin-bottom:0;" action=...>
 
You can also use a CSS style sheet to affect all the forms on a page:
form { margin-bottom: 0 ; }
Just use the image as the link content, like this:
 
<a href=...><img src=... alt=...></a>
Advertisement