HTML External CSS Stylesheet


Example

<link rel="stylesheet" href="path/to.css" type="text/css">

The standard practice is to place CSS <link> tags inside the <head> tag at the top of your HTML. This way the CSS will be loaded first and will apply to your page as it is loading, rather than showing unstyled HTML until the CSS is loaded. The typeattribute is not necessary in HTML5, because HTML5 usually supports CSS.

 <link rel="stylesheet" href="path/to.css" type="text/css">

and

 <link rel="stylesheet" href="path/to.css">

... do the same thing in HTML5.

Another, though less common practice, is to use an @import statement inside direct CSS. Like this:

<style type="text/css">
    @import("path/to.css")
</style>

<style>
    @import("path/to.css")
</style>