html : Interview Questions
HTML stands for Hyper Text Markup Language. It is a language of World Wide Web. It is a standard text formatting language which is used to create and display pages on the Web. It makes the text more interactive and dynamic. It can turn text into images, tables, links.
HTML tags are composed of three things: an opening tag, content and ending tag. Some tags are unclosed tags.
HTML documents contain two things:
- content, and
When a web browser reads an HTML document, the browser reads it from top to bottom and left to right. HTML tags are used to create HTML documents and render their properties. Each HTML tags have different properties.
<tag> content </tag>
Content is placed between tags to display data on the web page.
No. There are some HTML tags that don't need a closing tag. For example: <image> tag, <br> tag.
The HTML formatting is a process of format the text for a better look and feel. It uses different tags to make text bold, italicized, underlined.
The HTML contains six types of headings which are defined with the <h1> to <h6> tags. Each type of heading tag displays different text size from another. So, <h1> is the largest heading tag and <h6> is the smallest one. For example:
<h1>Heading no. 1</h1> <h2>Heading no. 2</h2> <h3>Heading no. 3</h3> <h4>Heading no. 4</h4> <h5>Heading no. 5</h5> <h6>Heading no. 6</h6>
The HTML provides an anchor tag to create a hyperlink that links one page to another page. These tags can appear in any of the following ways:
- Unvisited link - It is displayed, underlined and blue.
- Visited link - It is displayed, underlined and purple.
- Active link - It is displayed, underlined and red.
There are many common lists which are used to design a page. You can choose any or a combination of the following list types:
- Ordered list - The ordered list displays elements in numbered format. It is represented by
- Unordered list - The unordered list displays elements in bulleted format. It is represented by
- Definition list - The definition list displays elements in definition form like in dictionary. The
- tags are used to define description list.
HTML elements communicate to the browser to render text. When the elements are enclosed by brackets <>, they form HTML tags. Most of the time, tags come in a pair and surround content.
Semantic HTML is a coding style. It is the use of HTML markup to reinforce the semantics or meaning of the content. For example: In semantic HTML <b> </b> tag is not used for bold statement as well as <i> </i> tag is used for italic. Instead of these we use <strong></strong> and <em></em> tags.
Image map facilitates you to link many different web pages using a single image. It is represented by <map> tag. You can define shapes in images that you want to make part of an image mapping.
You can insert a copyright symbol by using © or © in an HTML file.
You can keep the list elements straight by using indents.
No, you can use hyperlinks on text and images both. The HTML anchor tag defines a hyperlink that links one page to another page. The "href" attribute is the most important attribute of the HTML anchor tag.
<a href = "..........."> Link Text </a>
A style sheet is used to build a consistent, transportable, and well-designed style template. You can add these templates on several different web pages. It describes the look and formatting of a document written in markup language.
Yes. To create a multicolor text on a web page you can use <font color ="color"> </font> for the specific texts you want to color.
The color of the bullet is always the color of the first text of the list. So, if you want to change the color of the bullet, you must change the color of the text.
Marquee is used to put the scrolling text on a web page. It scrolls the image or text up, down, left or right automatically. You should put the text which you want to scroll within the <marquee>......</marquee> tag.
Three tags are used to separate the texts.
tag - Usually
tag is used to separate the line of text. It breaks the current line and conveys the flow to the next line
tag - The
tag contains the text in the form of a new paragraph.
tag - It is used to define a large quoted section. If you have a large quotation, then put the entire text within
To make a picture a background image on a web page, you should put the following tag code after the </head> tag.
Here, replace the "image.gif" with the name of your image file which you want to display on your web page.
<body background = "image.gif">
HTML elements with no content are called empty elements. For example: <br>, <hr> etc.
The span tag is used for following things:
- For adding color on text
- For adding background on text
- Highlight any color text
In this page we use span.
The HTML character entities are used as a replacement for reserved characters in HTML. You can also replace characters that are not present on your keyboard by entities. These characters are replaced because some characters are reserved in HTML.
No, the <!DOCTYPE html> declaration is not an HTML tag. There are many type of HTML e.g. HTML 4.01 Strict, HTML 4.01 Transitional, HTML 4.01 Frameset, XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, XHTML 1.1 etc. So, <!DOCTYPE html> is used to instruct the web browser about the HTML page.