general elements and attributes Flashcards

2
Q

What does ‹tt› tag do in HTML5?

A

‹tt› is not supported in HTML5.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does ‹summary› tag do in HTML5?

A

It is used to define the header of a “detail” element. It is only supported in Chrome. e.g.
‹details›
‹summary›Copyright 2000-2011.‹/summary›
‹p›ABC Company‹/p› ‹/details›

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does ‹ul› tag do in HTML5?

A

‹ul› tag defines an unordered list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does ‹wbr› tag do in HTML5?

A

‹wbr› tag defines a possible line-break.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does ‹sup› tag do in HTML5?

A

‹sup› is used to define superscripted text. e.g. ‹sub› superscripted text goes here ‹/sub›

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does ‹xmp› tag do in HTML5?

A

This tag does not work in HTML5.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the hidden attribute do?

A

It is used to specify that the element is not relevant. Hidden elements are not displayed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which attribute is used to specify language code for the content in an element?

A

The lang attribute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Name the five events which apply to the ‹body› tag.

A

onafterprint, onbeforeprint, onebeforeonload, onblur and onfocus.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Is ‹del› tag supported in all major browsers?

A

The ‹del› tag defines text that has been deleted from a document and it is supported in all major web browsers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Give an example of ‹del› tag.

A

‹p›My favorite car is ‹del›Mazda‹/del› ‹ins›red‹/ins›!‹/p›

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the purpose of using ‹!DOCTYPE› in HTML5?

A

‹!DOCTYPE› is an instruction to the web browser which informs the browser about the version of the markup language the page is written in.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Give an example of DOCTYPE that you will use in your HTML page if you wish to refer to DTD that does not include presentational or deprecated elements.

A

‹!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”›

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Is ‹!DOCTYPE› case sensitive?

A

NO, ‹!DOCTYPE› is not case sensitive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How to you define hyperlinks in HTML?

A

Hyperlinks are defined using the ‹a› tag, which is used to link from one page to another.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How do you differentiate between HTML4’s ‹a› tag and HTML5’s ‹a› tag?

A

In HTML 4, the ‹a› tag could be either a hyperlink or an anchor. In HTML5, the ‹a› tag is always a hyperlink.
Well, it’s very simple and has been supported by most browsers for several versions, you give the anchor/bookmark an ID and target that in your link.

[h1 id=”top”]My web page[/h1]
with the ‘top of page’ link being
[a href=”#top”]Top of page[/a]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the purpose of anchor tag’s href attribute?

A

It is used to specify the destination of the target URL.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Which tag is used instead of ‹acronym› in HTML5?

A

The tag ‹abbr› is used instead of ‹acronym› in HTML5.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What does ‹applet› tag do in HTML5?

A

The ‹applet› tag is not supported in HTML5.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Which tag is used instead of ‹applet› tag in HTML5?

A

The ‹object› tag is used instead of ‹applet› tag in HTML5.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What does ‹audio› tag do in HTML5?

A

The ‹audio› tag defines sound, such as music or other audio streams.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Is ‹basefont› tag supported in HTML5?

A

No, ‹basefont› tag is not supported in HTML5.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Which tag replaces ‹basefont› tag in HTML5?

A

CSS is used instead of ‹basefont› in HTML5.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What does ‹bdo› tag do?

A

The ‹bdo› tag allows you to specify the text direction and override the bidirectional algorithm.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What does bdo stand for?

A

bdo stands for bidirectional override.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Which tag will you use to reference to a quotation that is taken from another source?

A

The ‹blockquote› tag

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

How will you cite reference using blockquote tag?

A

cite attribute is used to give the reference. e.g. ‹blockquote› is the tag has an attribute called “cite”. ‹blockquote cite=”http://www.abc.com”›
Unity, Faith, Decipline ‹/blockquote›

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Name the attributes of the ‹button› tag.

A

There are eleven attributes of the ‹button› tag namely: autofocus, disabled, form, formaction, formenctype, formmethod, formnovalidate, formtarget, type, name and value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What does the ‹canvas› tag do?

A

The ‹canvas› tag is used as container for graphics.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What does the ‹fieldset› tag do?

A

The ‹fieldset› tag draws a box around the related form elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

Write a code to refresh page every 3 seconds.

A

‹meta http-equiv=”refresh” content=”3” /›.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

How will you define a description of your web page using meta tags?

A

‹meta name=”description” content=”Java Test” /›

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

Which tag is used instead of ‹xmp› in HTML5?

A

‹pre› tag is used instead of ‹xmp› in HTML5.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

Which values can you put as button tag’s type attribute?

A

submit, button, reset

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

How will you highlight parts of your text?

A

The ‹mark› tag is used to highlight parts of your text.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

What is the purpose of mark tag? Give Example.

A

It is used to mark text. e.g.

‹p›Update ‹mark›Windows‹/mark› today.‹/p›

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

What is the default value of button tag’s type attribute?

A

It defaults to submit, though different browsers may use different default values for the type attribute.

39
Q

I wish to add rows in colgroup element. How can this be done?

A

Not possible. Only columns can be added in the colgroup element.

40
Q

What does ‹ol› stand for?

A

‹ol› stands for ordered list.

41
Q

What does ‹li› stand for?

A

‹li› stands for list.

42
Q

Write a code of a simple HTML form with two input fields and one submit button.

A

‹form action=”form_action.asp”›
First name: ‹input type=”text” name=”fname” value=”Test1” /›‹br /› Last name:‹input type=”text” name=”lname” value=”Test2” /›‹br /› ‹input type=”submit” value=”Submit” /›
‹/form›

43
Q

What is the purpose of accept-charset attribute in form tag?

A

It is used to specify the character-sets the server can handle for form-data.

44
Q

Write an HTML code snippet to insert an image in web page.

A

‹img src=”computer.gif” alt=”Computer” /›

45
Q

Name the two attributes of ‹img› tag?

A

The ‹img› tag has two required attributes: src and alt. The alt attribute specifies an alternate text for an image and the src specifies the URL of an image.

46
Q

Which ‹img› tag attributes are not supported in HTML5?

A

Align, border, hspace and vspace are not supported in HTML5.

47
Q

What is the use of ismap attribute in ‹img› tag?

A

smap specifies an image as a server-side image-map.

48
Q

Which attribute of ‹img› tag is used to specify a client-side image-map?

A

usemap specifies an image as a client-side image-map.

49
Q

What is the role of web worker in HTML5?

A

The web worker allows JavaScript code to be set to run in a background process i.e. it helps in the development of multi-threaded applications.
The advantage of web workers is that intensive calculations can be processed in the background without adversely affecting the speed of the user interface.

50
Q

What do you know about geolocation API in HTML5?

A

It is used to support geographical based services by allowing a Web application to determine user’s current geographical location.

51
Q

Name the HTML5 feature that allows documents in different windows (and iframes, for that matter) to send and receive messages to one another?

A

It is referred to as cross-document messaging feature.

52
Q

Which feature of HTML5 is useful for the development of widgets and applications that are hosted on servers other than the primary Web page’s server?

A

The Cross-document messaging

53
Q

What is the general syntax to draw an outline rectangle on canvas in HTML5?

A

strokeRect(x,y,width,height)

54
Q

Which tag is useful to block the quotation that is taken from another source?

A

The ‹blockquote› tag is useful to block the quotation that is taken from another source.

55
Q

Name the tag in which the event onbeforeprint applies.

A

onbeforeprint event works in the ‹body› tag.

56
Q

What is the use of an ‹optgroup› tag?

A

The ‹optgroup› tag is used to group related options in a drop-down list.

57
Q

Give syntax example of ‹optgroup›.

A

‹select›
‹optgroup label=”white Cars”›
‹option value=”volvo”›Volvo‹/option› ‹option value=”suzzuki”›Saab‹/option› ‹/optgroup›
‹optgroup label=”Green Cars”›
‹option value=”vw”›VW‹/option› ‹option value=”audi”›Audi‹/option› ‹/optgroup›
‹/select›

58
Q

Which HTML tag defines a multi-line text input control?

A

The ‹textarea› tag

59
Q

How to set a parameter for the object element? Write code snippet.

A

‹object data=”song.ogg”›

‹param name=”autoplay” value=”false” /› ‹/object›

60
Q

Which attributes of ‹pram› tags are not supported in HTML5?

A

Only two attributes type and typevalue are not supported in HTML5.

61
Q

Write code snippet that will set focus to keygen field when the page gets loaded.

A

‹form action=”demo_keygen.asp” method=”get”›
Username: ‹input type=”text” name=”usr_name” /›
Encryption: ‹keygen name=”security” autofocus=”autofocus” /› ‹input type=”submit” /›
‹/form›

62
Q

Which coding flexibilities are provided by HTML5?

A

a) Uppercase tag names,
b) Quotes are optional for attributes,
c) Attribute values are optional,
d) Closing empty elements are optional.

63
Q

Give an example to show the use of itemprop and itemscope.

A

Support for the Microdata API has just been removed from Webkit (Apple Safari). Support for the Microdata API was also removed from Blink (Google Chrome) a few months ago. This means that Apple Safari and Google Chrome will no longer support the Microdata API. Removal of the feature from a browser also shows us a likely future for Microdata, which is less and less support.
‹div itemscope›‹p›I am going to ‹span itemprop=”name”›England‹/span›.‹/p› ‹/div›

64
Q

Which browsers do not have support for getitems()?

A

Support for the Microdata API has just been removed from Webkit (Apple Safari). Support for the Microdata API was also removed from Blink (Google Chrome) a few months ago. This means that Apple Safari and Google Chrome will no longer support the Microdata API. Removal of the feature from a browser also shows us a likely future for Microdata, which is less and less support.

Any browser that supports the HTML5 microdata API, will have support for getItems() function on the global document object. If a browser doesn’t support microdata, the getItems() function will be undefined.

65
Q

Name the sementic elements in HTML5.

A
header
nav
section
article
aside
figure
figcaption
footer
details
summary
mark
time
66
Q

What is DOM?

A

DOM (Document Object Model) defines relationships, attributes & methods of objects.

67
Q

What is meant by HTML Serialization?

A

The HTML serialization refers to the syntax of an HTML document defined in the HTML specification.

68
Q

Which MIME type does HTML use?

A

The HTML serialization must be served using the text/html MIME type.

69
Q

How do we specify character encoding?

A

We specify the encoding using HTTP Content-Type header.

[meta http-equiv=”Content-Type” content=”text/html;charset=ISO-8859-8”]

70
Q

What is the restriction on character coding?

A

The character encoding declaration must be serialized without the use of character references or character escapes of any kind.

71
Q

What does ‹sub› tag do?

A

The ‹sub› tag is used to define subscript text. Subscript text appears half a character below the baseline.

72
Q

Which HTML tag will you use to write superscript text in your web page?

A

The ‹sup› tag defines superscript text and hence it will be used. e.g.
‹sup›This is superscript text.‹/sup›

73
Q

Which property is used to specify the tab order of an element?

A

tabindex is used to specify the tab order of an element. e.g. HTMLElementObject.tabIndex=tabIndex

74
Q

In which browser min, max and step attributes work?

A

Opera 9.5 (and above) and Chrome 3.0 (and above) are the only browsers supporting min, max and step attributes.

75
Q

What are the valid values of canvas’s globalalpha property?

A

Valid values of canvas’s globalalpha property range from 0 and 1. Real values are allowed.

76
Q

In canvas’s globalalpha property, what do 0 and 1 mean?

A

In canvas’s globalalpha property 0 means no opacity and 1 means full opacity.

77
Q

How do you rotate a canvas and what is its unit of measurement?

A

To rotate the HTML5 Canvas, we use rotate() method. The rotate transformation is defined by an angle in radians.

78
Q

Using HTML5 canvas, how will you invert colors of an image?

A

We can iterate over all of the pixels in the image and invert the red, green, and blue components by subtracting each component from the max color value, 255.

79
Q

How can we create oscillation animation using HTML5 canvas?

A

This is possible using the KineticJS library. We need to use the equation for a simple harmonic oscillator in the updateStage() method of the Stage object.

80
Q

What is KineticJS in HTML5?

A

KineticJS is an HTML5 canvas library that extends the canvas API by providing support for animation and event handling.

81
Q

What is the purpose of body tag’s attribute onoffline?

A

Execute a JavaScript function when the browser starts to work offline.

82
Q

What can an audio element contain?

A

An audio element contains a src attribute or one or more source element, which may be followed by wither text or embedded content or text content enclosed by markup.

83
Q

Which elements can contain audio element?

A

Any element which can contain text or embedded content or text content enclosed by markup can contain audio element.

84
Q

Which browser supports the Semantic ‹progress› functionality?

A

Only Chrome and Opera support the Semantic ‹progress› functionality.

85
Q

How can you show an object’s downloading progress using HTML5?

A

HTML5 provides the ‹progress› tag to show work-in-progress. e.g.
Progress: ‹progress value=”60” max=”100”›60%‹/progress›

86
Q

How secure is the HTML5 storage database?

A

Within the browser, a web site can read/write in its own storage database i.e. other sites cannot access my sites database. HTML5 storage database is therefore secure.

87
Q

What is the purpose of ‹kbd› tag in HTML5?

A

It is used for indicating the text to be entered by the user.

[p]Type the following in the Run dialog: [kbd]cmd[/kbd][br /]Then click the OK button.[/p]

88
Q

Name few Event Handler Content Attributes.

A

ondragenter, ondrop, onselect, onstalled, onwaiting

89
Q

What can HTML5 do that Flash cannot?

A

HTML5 can run on Apple mobile devices like iPhones and iPads whereas Flash plugin is not directly supported on Apple mobile devices. HTML5 runs just as part of the browser, so there’s no separate plugin.

90
Q

What does the tag ‹noframes› do?

A

The ‹noframes› tag is used to display text for browsers that do not handle frames.

91
Q

What is CSS? How does it work?

A

CSS (Cascading Style Sheets) is a style sheet language used to describe the presentation semantics (the look and formatting) of a document written in a markup language.