Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

what is the correct syntax to add an external style sheet to a web page…

Question

what is the correct syntax to add an external style sheet to a web page?
options:
<link type=\text/css\ rel=\styles.css\ />
<style type=\text/css\ href=\styles.css\ />
<link href=\stylesheet\ type=\text/css\ rel=\styles.css\ />
<link rel=\stylesheet\ type=\text/css\ href=\styles.css\ />

Explanation:

Brief Explanations

To add an external style sheet, the <link> tag is used. The correct attributes are rel="stylesheet" (to define the relationship as a stylesheet), type="text/css" (to specify the MIME type), and href with the path to the CSS file. Let's analyze each option:

  • First option: rel should be "stylesheet", not the CSS file name, so incorrect.
  • Second option: <style> tag is for internal or embedded styles, not external, so incorrect.
  • Third option: href should point to the CSS file, not "stylesheet", and rel should be "stylesheet", so incorrect.
  • Fourth option: Has rel="stylesheet", type="text/css", and href pointing to the CSS file, which is correct.

Answer:

D. <link rel="stylesheet" type="text/css" href="styles.css" />