HTML Deck 3 Flashcards
What are Semantic Elements?
Semantic elements are those which describe the particular meaning to the browser and the developer. Elements like <form>, <table>, <article>, <figure>, etc., are semantic elements.</figure>
What is the difference between <meter> tag and <progress> tag?</progress></meter>
<progress> tag should be used when we want to show the completion progress of a task, whereas if we just want a scalar measurement within a known range or fraction value. Also, we can specify multiple extra attributes for <meter> tags like ‘form’, ‘low’, ‘high’, ‘min’, etc.
</meter></progress>
Is drag and drop possible using HTML5 and how?
Yes, in HTML5 we can drag and drop an element. This can be achieved using the drag and drop-related events to be used with the element which we want to drag and drop.
Difference between SVG and Canvas HTML5 element?
SVG VS Canvas
SVG is a vector based i.e., composed of shapes. It is Raster based i.e., composed of pixels.
SVG works better with a larger surface. Canvas works better with a smaller surface.
SVG can be modified using CSS and scripts. Canvas can only be modified using scripts.
SVG is highly scalable. So we can print at high quality with high resolution. It is less scalable.
What type of audio files can be played using HTML5?
HTML5 supports the following three types of audio file formats:
Mp3
WAV
Ogg
What are the significant goals of the HTML5 specification?
These were the target area of the HTML5 specs:
Introduction of new element tags to better structure the web page such as <header> tag.
Forming a standard in cross-browser behavior and support for different devices and platforms
Backward compatible with the older version HTML web pages
Introduction of basic interactive elements without the dependency of plugins such as <video> tag instead of the flash plugin.</video>
Explain the concept of web storage in HTML5.
This web storage helps in storing some of the static data in the local storage of the browser so that we do not need to fetch it from the server every time we need it. There is a size limit based on different browsers. This helps in decreasing the load time and a smooth user experience. There are two types of web storage that are used to store data locally in HTML5:
Local Storage - This helps in storing data that will be retained even though the user reopens the browser. It is stored for each webapp on different browsers.
Session Storage - This is used for one session only. After the user closes the browser this gets deleted.
What is Microdata in HTML5?
It is used to help extract data for site crawlers and search engines. It is basically a group of name-value pairs. The groups are called items, and each name-value pair is a property. Most of the search engines like Google, Microsoft, Yandex, etc follow schema.org vocabulary to extract this microdata.
<div>
<span>Interviewbit Games</span> -
REQUIRES <span>ANDROID</span><br></br>
<link></link>
<div>
RATING:
<span>4.6</span> (
<span>8864</span> ratings )
</div>
<div>
Price: Rs.<span>1.00</span>
<meta></meta>
</div>
</div>
itemid – The unique, global identifier of an item.
itemprop – Used to add properties to an item.
itemref – Provides a list of element ids with additional properties.
itemscope – It defines the scope of the itemtype associated with it.
itemtype – Specifies the URL of the vocabulary that will be used to define itemprop.
Which tag is used for representing the result of a calculation? Explain its attributes.
The <output> tag is used for representing the result of a calculation. It has the following attributes:</output>
for - It defines the relationship between the elements used in calculation and result.
form - This is used to define the form the output element belongs to.
name - The name of the output element.
<form>
<input></input> +
<input></input><br></br>
The output is: <output></output>
</form>
What is new about the relationship between the <header> and <h1> tags in HTML5?
As HTML5 was all about better semantics and arrangements of the tags and elements, the <header> tag specifies the header section of the webpage. Unlike in previous version there was one <h1> element for the entire webpage, now this is the header for one section such as <article> or <section>. According to the HTML5 specification, each <header> element must at least have one <h1> tag.
Explain HTML5 Graphics.
HTML5 supports two kinds of graphics:
Canvas - It is like drawing on a whitepaper or a blank webpage. We can add different graphic designs on web pages with available methods for drawing various geometrical shapes.
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<canvas></canvas>
</body>
</html>
SVG - Scalable Vector Graphics are used mostly for diagrams or icons. It follows the XML format.
<!DOCTYPE html>
<html>
<body>
<svg>
<rect></rect>
</svg>
</body>
</html>
Both of the above examples produce this output and represent two different approaches provided by HTML5 to implement graphical aspects in the webpage.
Explain new input types provided by HTML5 for forms?
Following are the significant new data types offered by HTML5:
Date - Only select date by using type = “date”
Week - Pick a week by using type = “week”
Month - Only select month by using type = “month”
Time - Only select time by using type = “time”.
Datetime - Combination of date and time by using type = “datetime”
Datetime-local - Combination of date and time by using type = “datetime-local.” but ignoring the timezone
Color - Accepts multiple colors using type = “color”
Email - Accepts one or more email addresses using type = “email”
Number - Accepts a numerical value with additional checks like min and max using type = “number”
Search - Allows searching queries by inputting text using type = “search”
Tel - Allows different phone numbers by using type = “tel”
Placeholder - To display a short hint in the input fields before entering a value using type = “placeholder”
Range - Accepts a numerical value within a specific range using type = “range”
Url - Accepts a web address using type = “url”
what is the difference between an element and a tag in html
HTML Tags are building blocks of HTML Page. HTML Elements are components that are used in HTML Page.
What are the New tags in Media Elements in HTML5?
<audio> - Used for sounds, audio streams, or music, embed audio content without any additional plug-in.
<video> - Used for video streams, embed video content etc.
<source></source> - Used for multiple media resources in media elements, such as audio, video, etc.
<embed></embed> - Used for an external application or embedded content.
<track></track> - Used for subtitles in the media elements such as video or audio.
<label>
Video:
</label>
<video>
<source></source>
<track></track>
</video>
<br></br>
<label>
Embed:
</label>
<embed></embed>
<br></br>
<label>
Audio:
</label>
<audio>
<source></source>
</audio>
</video></audio>
Why do you think the addition of drag-and-drop functionality in HTML5 is important? How will you make an image draggable in HTML5?
The drag and drop functionality is a very intuitive way to select local files. This is similar to what most of the OS have copy functionality thus making it very easy for the user to comprehend. Before the native drag and drop API, this was achievable by writing complex Javascript programming or external frameworks like jQuery.
To enable this functionality there is a draggable attribute in the <img></img> tag and need to set ondrop and ondragover attribute to an eventhandler available in scripts.
<!DOCTYPE HTML>
<html>
<head>
<script> function allowDrop(ev) { ev.preventDefault(); } function drop(ev) { ... } </script>
</head>
<body>
...
<div></div>
<br></br>
<img></img>
...
</body>
</html>
Why do we need the MathML element in HTML5?
MathML stands for Mathematical Markup Language. It is used for displaying mathematical expressions on web pages. For this <math> tag is used.</math>