HTML interview questions

HTML quiz questions

  • 1.

    What is a marquee?

    Answer:

    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.

    View
  • 2.

    Is it possible to change the color of the bullet?

    Answer:

    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.

    View
  • 3.

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

    Answer:

    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.

    View
  • 4.

    What is a style sheet?

    Answer:

    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.

    View
  • 5.

    Does a hyperlink only apply to text?

    Answer:

    No, you can use hyperlinks on text and images both.

    View
  • 6.

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

    Answer:

    You can keep the list elements straight by using indents.

    View
  • 7.

    How to insert a copyright symbol on a browser page?

    Answer:

    can insert a copyright symbol by using © or © in an HTML file.

    View
  • 8.

    What is image map?

    Answer:

    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.

    View
  • 9.

    What is semantic HTML?

    Answer:

    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.

    View
  • 10.

    What is the difference between HTML elements and tags?

    Answer:

    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.

    View
  • 11.

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

    Answer:

    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
    • Unordered list
    • Menu list
    • Directory list
    • Definition list
    View
  • 12.

    Do all HTML tags have end tag?

    Answer:

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

    View
  • 13.

    What are Tags?

    Answer:

    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.

    View
  • 14.

    What is HTML?

    Answer:

    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.

    View
  • 15.

    What is HTML5 Web Storage? Explain localStorage and sessionStorage.

    Answer:

    With HTML5, web pages can store data locally within the user’s browser.

    Earlier, this was done with cookies. However, Web Storage is more secure and faster. The data is not included with every server request, but used ONLY when asked for.

    The data is stored in name/value pairs, and a web page can only access data stored by itself. Unlike cookies, the storage limit is far larger (at least 5MB) and information is never transferred to the server.

    The difference between localStorage and sessionStorage involves the lifetime and scope of the storage.

    Data stored through localStorage is permanent: it does not expire and remains stored on the user’s computer until a web app deletes it or the user asks the browser to delete it. SessionStorage has the same lifetime as the top-level window or browser tab in which the script that stored it is running. When the window or tab is permanently closed, any data stored through sessionStorage is deleted.

    Both forms of storage are scoped to the document origin so that documents with different origins will never share the stored objects. But sessionStorage is also scoped on a per-window basis. If a user has two browser tabs displaying documents from the same origin, those two tabs have separate sessionStorage data: the scripts running in one tab cannot read or overwrite the data written by scripts in the other tab, even if both tabs are visiting exactly the same page and are running exactly the same scripts.

    View
  • 16.

    Write the code necessary to create a 300 pixel by 300 pixel <canvas>. Within it, paint a blue 100 pixel by 100 pixel square with the top-left corner of the square located 50 pixels from both the top and left edges of the canvas.

    Answer:

    Here is one simple implementation:

    <canvas id="c" width="300" height="300"></canvas>
    <script>
      var canvas = document.getElementById( "c" );
      var drawing_context = canvas.getContext( "2d" );
      drawing_context.fillStyle = "blue";
      drawing_context.fillRect( 50, 50, 100, 100 );
    </script>
    View
  • 17.

    Give a simple implementation of the <video> tag to embed a video stored at http://www.example.com/amazing_video.mp4. Give the video a width of 640 pixels by 360 pixels. Provide the user with controls.

    Answer:

    Here is one simple implementation:

    <video src="http://www.example.com/amazing_video.mp4" width="640" height="360" controls></video>
    

    Alternatively, the source file may be indicated with a separate <source> tag inside the <video> element, as in:

    <video width="640" height="360" controls>
      <source src="http://www.example.com/amazing_video.mp4">
    </video>
    View
  • 18.

    Describe the relationship between the <header> and <h1> tags in HTML5.

    Answer:

    In previous specifications of HTML, only one <h1> element was typically present on a page, used for the heading of the entire page. HTML5 specifies that <h1> represents the top-level heading of a “section”, whether that be the page <body>, or an <article> or <section> element. In fact, every <header> element should at least contain an <h1> element. If there is no natural heading for the section, it is a good indication it should not use an <article> or <section> tag.

    View
  • 19.

    Can a web page contain multiple <header> elements? What about <footer> elements?

    Answer:

    Yes to both. In fact, both the <header> and <footer> tags are designed to serve their respective purposes in relation to whatever their parent “section” may be. So not only can the page <body> contain a header and a footer, but so can every <article> and <section> element. In fact, a <header> should be present for all of these, although a <footer> is not always necessary.

    View
  • 20.

    Can a <section> contain <article> elements? Can an <article> contain <section> elements? Provide usage examples.

    Answer:

    The answer to both questions is yes; i.e., a <section> can contain <article> elements, and an <article> can contain <section> elements.

    For example, a personal dashboard page might contain a <section> for social network interactions as well as a <section> for the latest news articles, the latter of which could contain several <article> elements.

    Conversely, an <article> might contain a <section> at the end for reader comments.

    View

© 2017 QuizBucket.org