Unit summary

  • CSS controls presentation. A rule is a selector with declarations in braces.
  • CSS can be inline, internal or external, and an external sheet is best for a website.
  • Selectors choose elements, and specificity decides which rule wins.
  • Colours, fonts and line spacing control how text looks and how easily it reads.
  • The box model sets size with content, padding, border and margin.
  • Position, float, Flexbox and Grid place elements and build layouts.
  • Bootstrap adds a twelve-column grid, breakpoints, components and a modal.
  • HTTP carries pages, DNS finds servers and hosting keeps a site online.

Glossary

Term Meaning
Bootstrap A free CSS and JavaScript framework of ready-made responsive components.
Box model The model that treats every element as a box made of content, padding, border and margin.
Box-sizing A property that decides whether width and height include padding and border.
Colour value A way of writing a colour, such as a name, a hex code, rgb() or hsl().
CSS A style language that controls the colours, fonts, spacing and layout of HTML elements.
Declaration One property and its value, written as a pair such as color: red.
DNS The Domain Name System, which turns a domain name into an IP address.
External style sheet A separate .css file that many pages can link to.
Flexbox A one-dimensional layout model that arranges items in a row or in a column.
Float A property that moves an element left or right so that text wraps around it.
Grid A two-dimensional layout model that arranges items in rows and columns.
Grid system Bootstrap's twelve-column layout, built from container, row and column classes.
HTTP The protocol browsers and servers use to exchange web pages. HTTPS is its encrypted form.
Inline style A declaration written in the style attribute of a single element.
Modal A dialog box that appears above the page and asks for the user's attention.
Positioning The way an element is placed on the page, set with the position property.
Pseudo-class A keyword added to a selector that targets an element in a certain state, such as hover.
Selector The part of a CSS rule that chooses which elements to style.
Specificity The weight that decides which rule wins when several rules style the same element.
Web hosting A service that stores a website's files on a server connected to the internet.

Question bank

Short Answer Questions (2 marks each)

  1. What is CSS? State two benefits of using it.
  2. What is a declaration? Give an example.
  3. Name the three ways of adding CSS to a page.
  4. Differentiate between a class selector and an id selector.
  5. What is specificity?
  6. List the four layers of the CSS box model.
  7. What does box-sizing: border-box do?
  8. Name the five values of the position property.
  9. What is a Bootstrap breakpoint?
  10. What is the role of DNS?

Medium Answer Questions (5 marks each)

  1. Explain the three types of CSS with a short example of each.
  2. Explain the different CSS selectors with examples.
  3. Explain the CSS box model with a diagram and a worked example of total width.
  4. Explain the five values of the position property.
  5. Explain the Bootstrap grid system with a three-column example.
  6. Differentiate between shared, dedicated, VPS and cloud hosting.

Long Answer Questions (15 marks each)

  1. Explain how CSS is added to a page, how selectors choose elements and how specificity resolves conflicts, with examples.
  2. Explain Flexbox and Grid with their main properties. Design a page layout using each and state when each is the better choice.
  3. Describe Bootstrap and its components. Build a landing page with a navbar, a row of cards and a modal, and explain the classes used.
  4. Explain how a web page reaches a user, covering HTTP, HTTPS, the client-server model, DNS, web servers and the types of hosting.

Sources

  • Official BCA syllabus (NEP 2025 scheme), Web Application Development, course code 25BCA405DS04, Unit II