Blog Desk       February 10, 2020      937

What is the correct HTML for referring to an external style sheet ?

  1. <style src="mystyle.css">
  2. <stylesheet>mystyle.css</stylesheet>
  3. <link rel="stylesheet" type="text/css" href="mystyle.css">

The Right Answer is : Option C


What Does External Style Sheet Mean?

An external style sheet is a separate file linked to an HTML page. It comes with a .css filename extension (like: mystyle.css). All the styles that need to be used on a website can be declared in the external style sheet. External style sheets are an important file from the designer's perspective. Linked HTML Example:
<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="mystyle.css">