Which of the following is used to apply styles to HTML elements ?

2025

Which of the following is used to apply styles to HTML elements ?

  1. A.

    JavaScript

  2. B.

    CSS

  3. C.

    HTML

  4. D.

    PHP

Attempted by 130 students.

Show answer & explanation

Correct answer: B

The correct answer is Option B: CSS. Cascading Style Sheets (CSS) is the standard language specifically designed to describe the presentation of HTML elements, including layout, colors, fonts, and spacing. While JavaScript is used for interactivity and dynamic behavior on web pages, it does not primarily handle visual styling. HTML (Option C) is responsible for the structure and content of a webpage, not its appearance. Similarly, PHP (Option D) is a server-side scripting language used for backend logic and database interactions rather than frontend styling. Therefore, CSS is the dedicated tool for applying styles to HTML elements.

Explore the full course: Tpsc Assistant Technical Officer