Back to the 2020 paper

Module I: Introduction to Web Technologies & Architectures

20202m

Which of the following is an advantage of putting presentation information in a separate CSS file rather than in HTML itself?

(i) The content becomes easy to manage
(ii) Becomes easy to make site for different devices like mobile by making separate CSS files
(iii) CSS files are generally cached and therefore decrease server load and network traffic
(iv) All of the above

Worked SolutionAI Assisted

Correct Answer: (iv) All of the above

Explanation:

Separating presentation rules into an external .css file provides several key advantages:

  1. Maintainability & Separation of Concerns (i): HTML structure is decoupled from visual styling, allowing sitewide design changes by editing a single CSS file.
  2. Device Independence & Responsiveness (ii): Enables targeting distinct devices (mobiles, tablets, print) through separate stylesheets or CSS media queries (@media).
  3. Browser Caching & Performance (iii): External CSS files are cached by the browser after the first download, drastically reducing bandwidth consumption, network traffic, and server load on subsequent page requests.

Therefore, (iv) All of the above is the correct option.

Similar questions