Anna University

Web Technology — Exam Prep & Notes

All the study material you need for CS6501 / IT6501 (Internet Programming / Web Technology) — syllabus, 2-mark questions, 16-mark questions, and lab exercises.

CS6501 — Internet Programming
IT6501 — Web Technology
BE / B.Tech — Semester 5 / 6
Regulation 2013 / 2017 / 2021
📋

Syllabus — Unit-wise Topics

CS6501 / IT6501 — 5 units mapped to our free lessons

Unit Topics Covered Study Here
Unit I — HTML & CSS HTML5 elements, forms, tables, semantic tags, CSS selectors, box model, flexbox, media queries HTML Course  ·  CSS Course
Unit II — JavaScript Data types, operators, control flow, functions, arrays, objects, DOM, events, form validation JavaScript Course
Unit III — XML & Web Services XML syntax, DTD, XML Schema, XSLT, XPath, SOAP, REST, JSON, AJAX Coming soon — bookmark & check back
Unit IV — Server-side Scripting (PHP) PHP syntax, arrays, strings, form handling, sessions, cookies, MySQL connectivity Coming soon
Unit V — Emerging Technologies React basics, Node.js overview, web security, HTTPS, responsive design, PWA concepts Coming soon
✏️

Important 2-Mark Questions

Short-answer questions that frequently appear in AU end-semester exams

  • 2 Marks What is HTML5? List any four new features introduced in HTML5.
    HTML5 is the fifth revision of HTML with native support for audio, video, canvas, and semantic elements. New features:
    • <video>, <audio> — embed media without plugins
    • <canvas> — 2D drawing via JavaScript
    • Semantic tags: <header>, <nav>, <section>, <article>, <footer>
    • Local Storage & Session Storage API
  • 2 Marks What is the difference between id and class in CSS?
    id is unique — only one element per page can have a given id; selected with #idname. class can be shared across multiple elements; selected with .classname. id has higher specificity than class.
  • 2 Marks What is the CSS Box Model? Name its components.
    The Box Model describes the rectangular box around every HTML element. Components (outer to inner): MarginBorderPaddingContent. Total width = content + padding-left + padding-right + border-left + border-right + margin-left + margin-right.
  • 2 Marks What is JavaScript? How is it different from Java?
    JavaScript is a lightweight, interpreted scripting language that runs in the browser to make web pages interactive. Java is a compiled, object-oriented language used for standalone applications. They share similar syntax but are unrelated languages — JavaScript was named after Java for marketing reasons.
  • 2 Marks Difference between == and === in JavaScript.
    == (loose equality) compares values after type coercion — "5" == 5 is true. === (strict equality) compares both value AND type — "5" === 5 is false. Always prefer === to avoid unexpected bugs.
  • 2 Marks What is the DOM? Why is it important?
    DOM (Document Object Model) is a programming interface that represents an HTML page as a tree of objects. Every tag becomes a node. JavaScript uses the DOM to read and change page content dynamically — adding, removing, or modifying elements without reloading the page.
  • 2 Marks What is Flexbox? List two advantages.
    Flexbox is a CSS layout model that arranges items in a row or column. Advantages: (1) Easy to center elements both horizontally and vertically. (2) Items can automatically shrink or grow to fill available space — great for responsive design.
  • 2 Marks What is an event in JavaScript? Give two examples.
    An event is a signal that something happened in the browser. JavaScript code can "listen" for events and respond. Examples: click (user clicks a button), keydown (user presses a key), submit (form is submitted), load (page finishes loading).
  • 2 Marks What is the difference between var, let and const?
    var: function-scoped, hoisted, can be re-declared (avoid in modern JS). let: block-scoped, not hoisted, can be reassigned. const: block-scoped, cannot be reassigned — use for values that don't change.
  • 2 Marks What is a CSS selector? Name four types.
    A CSS selector targets HTML elements to apply styles. Types: (1) Element selector — p { }. (2) Class selector — .card { }. (3) ID selector — #header { }. (4) Attribute selector — input[type="text"] { }. Also: pseudo-class :hover, pseudo-element ::before.
📝

Important 16-Mark Questions

Long-answer questions — appear almost every exam. Learn these in detail.

  • 16 Marks Explain HTML5 semantic elements with examples. How do they differ from <div>?
    Semantic elements describe the meaning of content, not just its appearance. They help search engines and screen readers understand the page structure.
    • <header> — site/section header. Contains logo, nav, title.
    • <nav> — main navigation links.
    • <main> — primary content area (only one per page).
    • <section> — a thematic grouping with a heading.
    • <article> — self-contained content (blog post, news item).
    • <aside> — sidebar content loosely related to the main content.
    • <footer> — copyright, links, contact info.
    • <figure> / <figcaption> — image with caption.
    • <time> — machine-readable date/time.
    Vs <div>: <div> has no meaning — it's a generic container. Semantic elements tell browsers and assistive technologies what the content is, improving accessibility (WCAG) and SEO. Screen readers can jump directly to <main> or <nav> without reading the whole page.

    Study this lesson: Semantic HTML →
  • 16 Marks Explain CSS Flexbox layout model with all properties and examples.
    Flexbox operates on a container and its items.

    Container properties:
    • display: flex — activates flexbox
    • flex-direction: row | column | row-reverse | column-reverse
    • justify-content: flex-start | flex-end | center | space-between | space-around | space-evenly (main axis)
    • align-items: stretch | flex-start | flex-end | center | baseline (cross axis)
    • flex-wrap: nowrap | wrap | wrap-reverse
    • gap: space between items
    Item properties:
    • flex-grow: how much an item grows (default 0)
    • flex-shrink: how much it shrinks (default 1)
    • flex-basis: initial size before growing/shrinking
    • flex: 1 shorthand (grow=1, shrink=1, basis=0)
    • align-self: override align-items for one item
    • order: change visual order without changing HTML
    Common use case — centering: display:flex; justify-content:center; align-items:center;

    Study this lesson: CSS Flexbox →
  • 16 Marks Explain JavaScript functions: types, scope, closures, and arrow functions with examples.
    Function declaration: hoisted — can be called before definition.
    function greet(name) { return "Hello " + name; }

    Function expression: not hoisted.
    const greet = function(name) { return "Hello " + name; };

    Arrow function (ES6): shorter syntax, no own this.
    const greet = (name) => "Hello " + name;

    Scope: Variables declared inside a function are local to that function. let/const are block-scoped (inside { }). var is function-scoped.

    Closure: A function that remembers the variables from its outer (enclosing) scope even after the outer function has finished executing.
    function counter() {
      let count = 0;
      return function() { count++; return count; };
    }
    const inc = counter();
    inc(); // 1
    inc(); // 2  ← 'count' is closed over
    Study these lessons: Functions · Arrow Functions · Scope & Closures
  • 16 Marks Explain DOM manipulation in JavaScript with methods and examples.
    The DOM (Document Object Model) represents a page as a tree of nodes. JavaScript can read and change this tree.

    Selecting elements:
    • document.getElementById('id') — single element by id
    • document.querySelector('.class') — first matching CSS selector
    • document.querySelectorAll('p') — NodeList of all matches
    Reading/Changing content:
    • el.textContent — get/set text (safe)
    • el.innerHTML — get/set HTML markup
    • el.getAttribute('href') / el.setAttribute('href','url')
    Changing styles & classes:
    • el.style.color = 'red'
    • el.classList.add('active'), .remove(), .toggle()
    Creating/Removing elements:
    • document.createElement('div')
    • parent.appendChild(child)
    • el.remove()
    Events: el.addEventListener('click', function() { ... })

    Study these lessons: DOM Basics · Events · DOM Manipulation
  • 16 Marks Explain CSS Grid layout with all properties and a practical example.
    CSS Grid is a 2-dimensional layout system (rows AND columns).

    Container properties:
    • display: grid
    • grid-template-columns: 200px 1fr 1fr — defines column widths
    • grid-template-rows: auto 400px
    • gap: 16px — space between cells
    • grid-template-areas — named areas
    • justify-items / align-items — align content in cells
    Item properties:
    • grid-column: 1 / 3 — span from line 1 to 3
    • grid-row: 2 / 4
    • grid-area: header — place in named area
    Responsive grid: grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) — creates as many columns as will fit; each at least 250px wide.

    Study this lesson: CSS Grid →
🧪

Lab Exercises

Practical programs for Anna University Web Technology lab exam

1

Basic HTML Page

Create an HTML page with headings, paragraphs, ordered/unordered lists, image, and a hyperlink.

2

HTML Table

Design a student mark sheet using HTML tables with rowspan, colspan, borders and caption.

3

HTML Registration Form

Build a form with text, email, password, radio buttons, checkboxes, dropdown and submit button.

4

CSS Styling

Apply external CSS to style the registration form — fonts, colors, borders, hover effects.

5

Responsive Navbar

Create a navigation bar using HTML + CSS Flexbox that collapses on mobile screens.

6

CSS Grid Layout

Design a magazine-style page layout using CSS Grid with header, sidebar, main content, and footer.

7

JavaScript Form Validation

Write JS to validate a registration form — check empty fields, email format, password strength before submit.

8

DOM Manipulation

Build a to-do list where users can add, check off, and delete tasks using JavaScript DOM methods.

9

Image Gallery

Create an image gallery with CSS Grid. Clicking a thumbnail shows the full image using JavaScript.

10

Fetch API (AJAX)

Use the Fetch API to load and display JSON data from a public API without reloading the page.

11

Portfolio Website

Build a multi-section personal portfolio page using HTML5 semantic tags, CSS Flexbox/Grid and smooth scroll.

12

CSS Animation

Implement a loading spinner and a slide-in card animation using CSS @keyframes and transitions.

💡

Exam Tips for AU Students

From students who scored well in Web Technology

📌

Master the Box Model

CSS box model (content, padding, border, margin) appears in almost every exam. Draw a diagram and memorize the formula for total width.

📌

Learn Semantic Tags

HTML5 semantic elements are guaranteed 16-mark material. Know what each tag means and when to use it vs <div>.

📌

Write Code in Answers

Always include a code snippet in 16-mark answers. Examiners reward working examples. Even 10 lines of correct HTML/CSS adds marks.

📌

Flexbox vs Grid

Know the difference: Flexbox = 1D (row OR column). Grid = 2D (rows AND columns). A common question asks you to compare them.

📌

Practice Lab Programs

Lab programs are given 3 hours. Practice all 12 exercises until you can write them from memory. Lab exam = guaranteed 100 if you prepare.

📌

Units III–V Use W3Schools

Our XML/PHP/Ajax lessons are coming soon. For now, W3Schools has accurate reference pages. Focus on concepts and definitions for theory.