Search This Blog

Q11-Q15

Q11. What is Session Storage?
Q12. Few new features of HTML 5?
Q13. Is Doctype in HTML5 a required attribute?
Q14. What are Media queries in CSS3?
Q15. What is Canvas in HTML 5?
-------------------------------------------------------------------------------------------------------------------------
Q11. What is Session Storage?

Answer:
The sessionStorage object is equal to the localStorage object, except that it stores the data for only one session. The data is deleted when the user closes the specific browser tab or closes the browser.

Example
<script type="text/javascript">
// Check if the sessionStorage object exists
if(sessionStorage){
    // Store data
    sessionStorage.setItem("last_name", "Parker");
    // Retrieve data
    alert("Hi, " + localStorage.getItem("first_name") + " " + sessionStorage.getItem("last_name"));
} else{
    alert("Sorry, your browser do not support session storage.");
}
</script>

https://www.tutorialrepublic.com/html-tutorial/html5-web-storage.php
-------------------------------------------------------------------------------------------------------------------------
Q12. Few new features of HTML 5?

Answer:

  1. local storage and session storage.
  2. Introduction new elements like Email, placeholders, progress, time etc
  3. Introduction of headers and footers.
  4. Introduction of required attribute.
  5. no need to have  adobe flash and silver light.
  6. Introduction of Canvas by which u can manage graphics at run time using javascript.


New doctype.

old doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

New doctype
<!DOCTYPE html>

https://code.tutsplus.com/tutorials/28-html5-features-tips-and-techniques-you-must-know--net-13520
-------------------------------------------------------------------------------------------------------------------------
Q13. Is Doctype in HTML5 a required attribute?

Answer:
Yes but even if we don't define doctype at top of our page. browser will put it automatically at top of page and will render with default mode Standard Mode.
-------------------------------------------------------------------------------------------------------------------------
Q14. What are Media queries in CSS3?

Answer:
The @media rule is used to define different style rules for different media types/devices.
-------------------------------------------------------------------------------------------------------------------------
Q15. What is Canvas in HTML 5?

Answer:
The HTML <canvas> element is used to draw graphics, on the fly, via JavaScript. The <canvas> element is only a container for graphics.
-------------------------------------------------------------------------------------------------------------------------

No comments:

Post a Comment