Which of the following is the correct way to include a CSS file in an HTML…

2025

Which of the following is the correct way to include a CSS file in an HTML document ?

  1. A.

    <link href="style.css" />

  2. B.

    <css href="style.css">

  3. C.

    <style src="style.css">

  4. D.

    <link rel="stylesheet" href="style.css">

Attempted by 89 students.

Show answer & explanation

Correct answer: D

The correct way to include a CSS file in an HTML document is by using the <link> element within the <head> section. This element specifies the relationship between the HTML document and an external stylesheet using rel="stylesheet".

Explore the full course: Tpsc Assistant Technical Officer