HTML Interview Questions

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What are some common lists that are used when designing a page?

3 different types of HTML lists: Ordered list Unordered list Definition list

How many tags can be used to separate section of texts?

3 tags <br> tag is used to separate line of texts. <p> tag <blockquote> tag.

How to make a picture a background image of a web page?

<body background = "image.gif">

What are the drawbacks of cookies?

Cookies have following drawbacks− Cookies are included with every HTTP request, thereby slowing down your web application by transmitting the same data. Cookies are included with every HTTP request, thereby sending data unencrypted over the internet. Cookies are limited to about 4 KB of data . Not enough to store required data.

What is a marquee?

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.

Are HTML tags case sensitive?

NO!

Name some of the new features of HTML5.

New Semantic Elements Forms 2.0 Persistent Local Storage WebSocket Server-Sent Events Canvas Audio & Video Geolocation Microdata Drag and drop

Do all HTML tags have end tag?

No. There are some HTML tags that don't need a closing tag. For example: <image> tag, <br> tag.

datetime-local input control in Web form 2.0?

It represents a date and time (year, month, day, hour, minute, second, fractions of a second) encoded according to ISO 8601 with no time zone information.

datetime input control in Web form 2.0?

It represents a date and time (year, month, day, hour, minute, second, fractions of a second) encoded according to ISO 8601 with the time zone set to UTC.

When a session storage data gets deleted?

The Session Storage Data would be deleted by the browsers immediately after the session gets terminated.

Can you use SVG tags directly in HTML5 without any plugin?

Yes! HTML5 allows embeding SVG directly using <svg>...</svg> tag.

When a local storage data gets deleted?

local storage data has no time limit. To clear a local storage setting you would need to call localStorage.remove('key'); where 'key' is the key of the value you want to remove. If you want to clear all settings, you need to call localStorage.clear() method.

'figure' tag in HTML5?

used to associate a caption together with some embedded content, such as a graphic or video.

custom attributes in HTML5?

A custom data attribute starts with data- and would be named based on your requirement. Following is the simple example− <div class="example" data-subject="physics" data-level="complex"> ... </div> The above will be perfectly valid HTML5 with two custom attributes called data-subject and data-level. You would be able to get the values of these attributes using JavaScript APIs or CSS in similar way as you get for standard attributes.

number input control in Web form 2.0?

This control accepts only numerical value. The step attribute specifies the precision, defaulting to 1.

clearPosition() method of geolocation object of HTML5?

cancels an ongoing watchPosition call.

What is the use of span tag?

Small changes in for text such as: For adding color on text For adding background on text Highlight any color text etc.

How to insert a copyright symbol on a browser page?

using &copy; or &#169; in an HTML file.

How do you keep list elements straight in an HTML file?

using indents.

What is the difference between HTML elements and tags?

- HTML elements communicate to the browser to render text. When the elements are surrounded by brackets <>, they form HTML tags. - Most of the time, tags come in pair and surround content.

What is HTML?

- 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.

What is HTML5?

- is the next major revision of the HTML standard superseding HTML 4.01, XHTML 1.0, and XHTML 1.1. - is a standard for structuring and presenting content on the World Wide Web.

'video' tag in HTML5?

- used to embed a video file in an HTML or XHTML document. -The current HTML5 draft specification does not specify which video formats browsers should support in the video tag. But most commonly used video formats are− Ogg , mpeg4 -You can use <source> tag to specify media along with media type and many other attributes. An audio element allows multiple source elements and browser will use the first recognized format.

'audio' tag in HTML5?

- used to embed sound content in an HTML or XHTML document. - The current HTML5 draft specification does not specify which audio formats browsers should support in the audio tag. But most commonly used audio formats are ogg, mp3 and wav. -can use <source> tag to specify media along with media type and many other attributes. An audio element allows multiple source elements and browser will use the first recognized format.

What is Geolocation API in HTML? Keywords; - share your location w/ web sites - Javascript capture your latitude and longitude -work with a new property of the global navigator object - Geolocation object

-HTML5 Geolocation API lets you share your location with your favorite web sites. -A Javascript can capture your latitude and longitude and can be sent to backend web server and do fancy location-aware things like finding local businesses or showing your location on a map. Today most of the browsers and mobile devices support Geolocation API. The geolocation APIs work with a new property of the global navigator object ie. Geolocation object which can be created as follows: var geolocation = navigator.geolocation; The geolocation object is a service object that allows widgets to retrieve information about the geographic location of the device.

What is semantic HTML?

-Semantic HTML is a coding style. It is the use of HTML markup to reinforce the semantics or meaning of the content. -<b> </b> tag is not used for bold statement : we use <strong></strong> -<i> </i> tag is not used for italic :we use <em></em> tags.

What are the steps of server side scripts for SSE?

1) Send Content-type : server side script should send Content-type header specifying the type text/event-stream as follows− print "Content-Type: text/event-stream\n\n"; 2) Send Event: After setting Content-Type, server side script would send an Event − tag followed by event name. Following example would send Server-Time as event name terminated by a new line character. print "Event: server-time\n"; 3) send event data: Final step is to send event data using Data − tag which would be followed by integer of string value terminated by a new line character as follows− $time = localtime(); print "Data: $time\n";

What is Server Side Events in HTML5?

Along with HTML5, WHATWG Web Applications 1.0 introduces events which flow from web server to the web browsers and they are called Server-Sent Events (SSE). Using SSE you can push DOM events continously from your web server to the visitor's browser. The event streaming approach opens a persistent connection to the server, sending data to the client when new information is available, eliminating the need for continuous polling. Server-sent events standardizes how we stream data from the server to the client.

What are empty elements?

HTML elements with no content are called empty elements. For example: <br>, <hr> etc.

What are Tags?

HTML tags are composed of three things: opening tag, content and ending tag. Some tags are unclosed tags. -HTML documents are made of two things: content and tags - Content is placed between tags to display data on the web page.

'canvas' tag in HTML5?

HTML5 element <canvas> gives you an easy and powerful way to draw graphics using JavaScript. It can be used to draw graphs, make photo compositions or do simple (and not so simple) animations.

'placeholder' attribute in HTML5?

HTML5 introduced a new attribute called placeholder. This attribute on <input> and <textarea> elements provides a hint to the user of what can be entered in the field. The placeholder text must not contain carriage returns or line-feeds.

'required' attribute in HTML5?

HTML5 introduced a new attribute called required which would insist to have a value in an input control.

'output' tag in HTML5?

HTML5 introduced a new element <output> which is used to represent the result of different types of output, such as output written by a script.

local storage in HTML5?

HTML5 introduces the localStorage attribute which would be used to access a page's local storage area without no time limit and this local storage will be available whenever you would use that page.

session storage in HTML5?

HTML5 introduces the sessionStorage attribute which would be used by the sites to add data to the session storage, and it will be accessible to any page from the same site opened in that window i.e. session and as soon as you close the window, session would be lost.

What is image map?

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

If I do not put <!DOCTYPE html> will HTML 5 work?

No, browser will not be able to identify that it is a HTML document and HTML 5 tags will not function properly.

range input control in Web form 2.0?

The range type is used for input fields that should contain a value from a range of numbers.

What is the purpose of Socket.bufferedAmount atribute of WebSocket?

The readonly attribute bufferedAmount represents the number of bytes of UTF-8 text that have been queued using send() method.

What is the purpose of Socket.readyState atribute of WebSocket?

The readonly attribute readyState represents the state of the connection 0 : connection has not yet been established. 1 : connection is established and communication is possible. 2 : connection is going through the closing handshake. 3 :connection has been closed or could not be opened.

url input control in Web form 2.0?

This accepts only URL value. This type is used for input fields that should contain a URL address. If you try to submit a simple text, it forces to enter only URL address either in http://www.example.com format or in http://example.com format.

email input control in Web form 2.0?

This accepts only email value. This type is used for input fields that should contain an e-mail address. If you try to submit a simple text, it forces to enter only email address in [email protected] format.

'autofocus' attribute in HTML5?

This is a simple one-step pattern, easily programmed in JavaScript at the time of document load, automatically focus one particular form field.

How to utilize a server-sent event in HTML5?

To use Server-Sent Events in a web application, you would need to add an <eventsource> element to the document. The src attribute of <eventsource> element should point to an URL which should provide a persistent HTTP connection that sends a data stream containing the events. The URL would point to a PHP, PERL or any Python script which would take care of sending event data consistently.

Is it possible to change the color of the bullet?

Using ul li:before

Web Workers?

Web Workers do all the computationally expensive tasks without interrupting the user interface and typically run on separate threads. Web Workers allow for long-running scripts that are not interrupted by scripts that respond to clicks or other user interactions, and allows long tasks to be executed without yielding to keep the page responsive.

Is HTML5 backward compatible with old browsers?

Yes! HTML5 is designed, as much as possible, to be backward compatible with existing web browsers. New features build on existing features and allow you to provide fallback content for older browsers. It is suggested to detect support for individual HTML5 features using a few lines of JavaScript.

Can you use MathML tags directly in HTML5 without any plugin?

Yes! The HTML syntax of HTML5 allows for MathML elements to be used inside a document using <math>...</math> tags.

Can you create a multi colored text on a web page?

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.

What are the new <input> types for form validation in HTML5?

email, url, number, tel and date.

What are web sockets? Keyword : - next-generation bidirectional communication technology -for web applications -operates over a single socket -exposed via a JavaScript interface -send() method - API creates a new WebSocket object. - var Socket = new WebSocket(url, [protocal] );

is a next-generation bidirectional communication technology for web applications which operates over a single socket and is exposed via a JavaScript interface in HTML 5 compliant browsers. Once you get a Web Socket connection with the web server, you can send data from browser to server by calling a send() method, and receive data from server to browser by an onmessage event handler. Following is the API which creates a new WebSocket object. var Socket = new WebSocket(url, [protocal] ); Here first argument, url, specifies the URL to which to connect. The second attribute, protocol is optional, and if present, specifies a sub-protocol that the server must support for the connection to be successful.

What is Web Forms 2.0?

is an extension to the forms features found in HTML4. Form elements and attributes in HTML5 provide a greater degree of semantic mark-up than HTML4 and remove a great deal of the need for tedious scripting and styling that was required in HTML4.

What is 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.

Does a hyperlink only apply to text?

on text and images both

date input control in Web form 2.0?

represents a date (year, month, day) encoded according to ISO 8601.

month input control in Web form 2.0?

represents a date consisting of a year and a month encoded according to ISO 8601.

week input control in Web form 2.0?

represents a date consisting of a year and a week number encoded according to ISO 8601.

'footer' tag in HTML5?

represents a footer for a section and can contain information about the author, copyright information, et cetera.

'section' tag in HTML5?

represents a generic document or application section. It can be used together with h1-h6 to indicate the document structure.

'aside' tag in HTML5?

represents a piece of content that is only slightly related to the rest of the page.

'nav' tag in HTML5?

represents a section of the document intended for navigation

time input control in Web form 2.0?

represents a time (hour, minute, seconds, fractional seconds) encoded according to ISO 8601.

'article' tag in HTML5?

represents an independent piece of content of a document, such as a blog entry or newspaper article.

'header' tag in HTML5?

represents the header of a section.

watchPosition() method of geolocation object of HTML5?

retrieves periodic updates about the current geographic location of the device.

What is purpose of getCurrentPosition() method of geolocation object of HTML5?

retrieves the current geographic location of the user.

What is the use of iframe tag?

used to display a web page within a web page. <iframe src="demo_iframe.html" width="200px" height="200px"></iframe>

'dialog' tag in HTML5?

used to mark up a conversation.


Ensembles d'études connexes

Macroeconomics - Unit 2 study Guide

View Set

SSUIL: Honour in the Dust: supplemental documents part 5 - primary sources and other writings

View Set

GACE: Major American Authors & Summary of Works

View Set

Personal Finance: Chapter 5 Quiz

View Set

AC341 Final, SOC, SOC Reports, CHAPTER 6/7, Audit Chapter 25, Auditing Chapter 6, Flashcards, Five components of COSO Internal control framework (CRIME), Cases, ADVANCED AUDITING FINAL PREP, ASC Judgement, Week 2 - Case 4.4: Waste Management Inc., Fl...

View Set

5.1 Developmental Issues, Prenatal Development, and the Newborn

View Set

Chapter 6: Entrepreneurship and Starting a Small Business

View Set

Molecular and Cellular Physiology of Vascular Smooth Muscle Cells

View Set