Tayler Pierre
Tayler Pierre

Reputation: 13

CSS file not loading on HTML

I am currently coding in notepad, not sure if that contributes to my issue or not. But I have changed the link to the css file multiple times and it is still not showing up on my web page. This is my code:

<DOCTYPE!>
<html>
<head>
<meta charset= "UTF-8'>
<meta name="description" content="resume">
<meta name="keywords" content="HTML, CSS, XML, JavaScript">
<meta name="author" content="Tayler Pierre">
<link href="/css/style.css" rel="stylesheet" type="text/css"/>
<link href="https://www.fontsquirrel.com/fonts/Caviar-Dreams rel='stylesheet' type='text/css'/>
</head>

I can not figure this out please help.

Upvotes: 0

Views: 104

Answers (3)

Kevin
Kevin

Reputation: 862

You are trying to include 2 different CSS files, it is unclear which one is not loading for you. In case your own style.css is not loading, you are probably trying to include it from a different path then where to actual file is.

For the https://www.fontsquirrel.com/fonts/Caviar-Dreams font file, you are missing " in the include it self. Replace the line with the following:

<link href="https://www.fontsquirrel.com/fonts/Caviar-Dreams" rel='stylesheet' type='text/css'/>

You have some other minor errors in your code, take a look at this answer of Ben Tegoni for some suggested improvements.

Upvotes: 0

Ben Tegoni
Ben Tegoni

Reputation: 219

You have three errors in your code:

  1. <meta charset= "UTF-8'>

  2. <link href="https://www.fontsquirrel.com/fonts/Caviar-Dreams rel='stylesheet' type='text/css'/>

  3. <DOCTYPE!>

Just for safety, also change:

  1. <link href="/css/style.css" rel="stylesheet" type="text/css"/>


Overall this is what your code should look like:

<!DOCTYPE html>
<html>
<head>
<meta charset= "UTF-8">
<meta name="description" content="resume">
<meta name="keywords" content="HTML, CSS, XML, JavaScript">
<meta name="author" content="Tayler Pierre">
<link href="css/style.css" rel="stylesheet" type="text/css"/>
<link href="https://www.fontsquirrel.com/fonts/Caviar-Dreams" rel='stylesheet' type='text/css'/>
</head>

Upvotes: 2

avlyn92
avlyn92

Reputation: 49

Maybe you should try to properly close the href attribute of the last link tag.

<link href="https://www.fontsquirrel.com/fonts/Caviar-Dreams" rel="stylesheet" type='text/css'/>

Upvotes: 0

Related Questions