HTML viva questions test your knowledge of document structure, semantic tags, storage APIs, and the HTML vs HTML5 difference. Common topics include the DOCTYPE declaration, localStorage vs sessionStorage, form input types, and Bootstrap’s 12-column grid — all regularly asked in Indian university lab vivas and campus placement rounds at institutions like VTU, Anna University, and Mumbai University.
HTML viva questions cover markup fundamentals, the browser rendering model, and the evolution from HTML 4.01 to HTML5. The most common topics include semantic elements like <article> and <section>, form attributes, the localStorage and sessionStorage APIs, and Bootstrap’s grid system. Knowing these cold gives you a real edge in campus placements, technical interviews, and lab viva exams across Indian engineering colleges.
- Key Takeaway 1: HTML5 introduced semantic tags, native audio/video, canvas, and storage APIs that plain HTML 4 never had.
- Key Takeaway 2: Semantic elements improve SEO and accessibility, not just code readability.
- Key Takeaway 3:
localStoragepersists data across browser sessions;sessionStorageclears when the tab closes. - Key Takeaway 4: Bootstrap’s 12-column grid is one of the most-tested frontend concepts in entry-level developer interviews.
- Key Takeaway 5: Interviewers at companies like TCS, Infosys, and Wipro regularly use HTML questions and answers to filter candidates at the first technical round.
HTML vs HTML5: What Every Interviewer Wants to Know
HTML, or HyperText Markup Language, was standardised through several versions from the early 1990s. HTML5 arrived as a W3C Recommendation in October 2014 and changed how browsers handle multimedia, forms, and offline storage. According to the Web Almanac 2023 published by HTTP Archive, over 92% of web pages now use the HTML5 doctype, which tells you how dominant it has become.
The single biggest shift is the doctype declaration. HTML 4.01 required a long, complex DOCTYPE string referencing a DTD file. HTML5 simplified it to just <!DOCTYPE html>, a change that trips up many students in html viva questions during practical exams.
Core Differences at a Glance
| Feature | HTML 4.01 | HTML5 |
|---|---|---|
| DOCTYPE | Long DTD-based string | <!DOCTYPE html> |
| Multimedia | Requires Flash or plugins | Native <audio> and <video> tags |
| Semantic elements | Not available | <header>, <nav>, <article>, <section>, <footer> |
| Storage APIs | Cookies only | localStorage, sessionStorage, IndexedDB |
| Canvas/SVG | Not natively supported | Built-in <canvas> element |
| Form input types | text, password, checkbox, radio | email, date, range, color, tel, url |
| Geolocation | Not available | Geolocation API built in |
These differences are exactly what examiners at institutions like VTU, Anna University, and Mumbai University target in practical viva sessions. Memorising the table above is not enough; you need to explain why each change matters to a real project.
HTML5 Interview Questions and Answers: The Core Topics
Most HTML5 interview questions and html viva questions cluster around four areas: semantic markup, forms, storage, and the canvas element. Interviewers at product companies go deeper on storage APIs and accessibility. Service-based companies like TCS and Cognizant tend to focus on forms and basic structure. Knowing both angles prepares you for almost any room.
Semantic Tags in HTML5 Viva Questions
Semantic tags give meaning to your markup. A <div> tells the browser nothing about what is inside it. A <nav> tells both the browser and screen readers that this block contains navigation links. That difference matters for SEO and for users who rely on assistive technology.
The main semantic elements you must know for html viva questions are: <header>, <footer>, <main>, <article>, <section>, <aside>, <nav>, and <figure>. WebAIM’s 2024 Screen Reader User Survey found that 72.5% of screen reader users rely on landmark regions, which are created by semantic HTML elements, to navigate pages. That is a real-world reason to care about semantics beyond exam marks.
HTML5 Forms and Input Types
HTML5 added input types like email, tel, url, date, range, and color. These types trigger native validation and mobile-friendly keyboards without JavaScript. An email input, for example, automatically checks for the “@” symbol before form submission.
The required, placeholder, pattern, and autofocus attributes are also heavily tested in html viva questions. Know the difference between action and method on a form tag, and understand when you would use GET versus POST.
localStorage vs sessionStorage: A Key HTML Viva Question
Both APIs store key-value pairs in the browser without sending data to the server on every request. The difference is scope and lifetime. localStorage keeps data until the user explicitly clears it, even if they close the browser and come back a week later. sessionStorage is wiped the moment the tab or window closes.
Both are limited to around 5 MB per origin in most browsers, compared to cookies which cap at 4 KB. Neither is suitable for sensitive data like passwords or tokens because JavaScript running on the same origin can read them freely. That security angle often comes up in html viva questions, especially if you are targeting roles that touch web application security. If you want to go deeper on that topic, our guide on cybersecurity interview questions covers exactly how these vulnerabilities are exploited.
The canvas Element
The <canvas> element provides a bitmap drawing surface that you control entirely through JavaScript. It has no built-in accessibility support, which is a common trick question in html viva questions. You draw shapes, charts, and animations using the Canvas 2D API or WebGL. Unlike SVG, canvas is raster-based, so scaling it up makes it look pixelated.
Bootstrap Interview Questions You Should Prepare
Bootstrap is the most widely used CSS framework in the world. Stack Overflow’s 2023 Developer Survey reported that Bootstrap was used by 19.1% of professional developers, making it the top CSS framework globally. Indian companies building internal dashboards, e-commerce portals, and admin panels use Bootstrap heavily, so bootstrap interview questions appear in most junior frontend roles alongside standard html viva questions.
The 12-Column Grid System
Bootstrap’s grid is built on a 12-column flexbox layout. You define column widths using classes like col-md-6, which means “take up 6 of the 12 columns on medium screens and above.” The breakpoints are xs (below 576px), sm (576px), md (768px), lg (992px), xl (1200px), and xxl (1400px).
Interviewers often ask why 12 columns specifically. The answer is divisibility: 12 divides evenly into halves, thirds, quarters, and sixths, giving you flexible layout options without fractional columns.
Common Bootstrap Questions and Answers
- What is a container in Bootstrap? A fixed-width wrapper that centres content and adds responsive padding. container-fluid stretches to full width.
- What is the difference between .d-none and visibility: hidden? .d-none removes the element from the flow; visibility: hidden hides it but keeps the space.
- What utility classes handle spacing? Bootstrap uses m- for margin and p- for padding, combined with direction (t, b, s, e, x, y) and size (0 to 5 or auto).
- What is the purpose of the row class? It creates a flex container that negates the horizontal padding of the parent container, allowing columns to align correctly.
If you are building skills beyond HTML and want to understand which technical certifications pay off in India, check out our list of top online courses for high-salary jobs in 2025. Frontend skills alone rarely command top salaries without a security or data layer on top.
Speaking of data, if your interest leans toward analytics rather than pure frontend work, our data analyst interview questions guide covers the SQL, Python, and statistics questions that hiring managers actually ask.
How to Prepare HTML Viva Questions This Week
Knowing the theory is only half the work. Interviewers at Indian IT companies increasingly ask you to write or correct code on a whiteboard or shared editor. Practice writing a valid HTML5 boilerplate from memory. Build a small two-page site using semantic tags and Bootstrap’s grid without copying from a template.
The most effective preparation method for html viva questions is spaced repetition. Go through 10 html viva questions on day one, revisit them on day three, and test yourself again on day seven. Tools like Anki make this easy and free. Pair that with at least two hours of hands-on coding per day and you will cover the gap between knowing the answer and being able to explain it under pressure.
Career clarity matters as much as technical prep. If you are still deciding which path fits you, our article on how to choose the right career path after graduation gives a practical framework. And if you are a student wondering which skills to prioritise before your final year, our breakdown of top skills every college student must learn before graduation is worth reading this weekend.
- Write a valid HTML5 page from scratch, without IDE hints, by day two.
- Build one Bootstrap grid layout using at least three breakpoints.
- Explain localStorage vs sessionStorage out loud, as if talking to an interviewer.
- Read the MDN documentation for at least five semantic tags you have not used before.
- Do a mock viva with a classmate or record yourself answering html viva questions and watch it back.
If frontend development is your entry point but you want to move toward security engineering, understanding how web vulnerabilities start at the HTML and JavaScript layer is essential. Our guide on what a cybersecurity analyst does explains the career path clearly. You can also browse all available courses at 3University’s course catalogue to see what fits your current level.
3University offers industry-aligned certification programmes in Cybersecurity, Ethical Hacking, AI, Blockchain, and Web3. Whether you are a final-year student, a working professional looking to switch tracks, or someone returning to tech after a gap, the programmes are built around practical skills that hiring managers actually test. Explore what is available and pick one programme to start this month rather than waiting for the right time.
Frequently Asked Questions
What is the difference between HTML and HTML5?
HTML5 is the fifth major revision of HTML, standardised by W3C in 2014. It introduced semantic elements like <article> and <nav>, native audio and video support, the <canvas> drawing element, localStorage and sessionStorage APIs, and a simplified DOCTYPE. HTML 4.01 required Flash plugins for multimedia and had no built-in storage APIs beyond cookies.
What HTML viva questions are asked most often?
The most common html viva questions cover the HTML vs HTML5 difference, the purpose of the DOCTYPE declaration, semantic vs non-semantic tags, block-level vs inline elements, form attributes like required and placeholder, the difference between id and class, and how localStorage differs from sessionStorage. In lab vivas at Indian universities, form creation and table structure are also frequently tested practically.
What are semantic tags in HTML5?
Semantic tags are HTML5 elements that describe the meaning of their content to both browsers and developers. Examples include <header>, <footer>, <main>, <article>, <section>, <aside>, and <nav>. They improve SEO because search engines better understand page structure, and they improve accessibility because screen readers use them as navigation landmarks.
How does localStorage differ from sessionStorage?
localStorage stores data with no expiry time; it persists across browser sessions until the user or application explicitly deletes it. sessionStorage stores data only for the duration of the browser tab session and is cleared automatically when the tab closes. Both are origin-scoped, hold up to approximately 5 MB, and are accessible only through JavaScript on the same origin.
What is DOCTYPE in HTML5 and why does it matter?
The DOCTYPE declaration tells the browser which version of HTML the page uses. In HTML5, it is simply <!DOCTYPE html>. Without it, browsers enter quirks mode and render the page inconsistently. This is one of the most frequently asked html viva questions in Indian engineering college practicals because it is easy to overlook and easy to test.
What Bootstrap questions come up in interviews?
Interviewers commonly ask about Bootstrap’s 12-column grid system, responsive breakpoints, the difference between container and container-fluid, spacing utility classes, and how to hide elements responsively using display utilities. Questions about Bootstrap components like modals, navbars, and cards also appear. Expect at least one question asking you to explain how you would create a two-column layout that stacks on mobile.
Last updated: September 2026. Reviewed by the 3University editorial team.