Home > Mobile >  I cannot t link my Css file to my Html file
I cannot t link my Css file to my Html file

Time:02-04

[enter code here][1]Beginner question:

I started to practice a few basics of html by trying to create a website. I wanna do more, to add more things, to make it more complex and appealing but I don't know why I'm not able to link my css file to my html file. Can someone tell me how do I fix it and how do can I be sure if they are paired or not?!

`Thanks!

https://justpaste.it/cy3lw

I tried to watch some youtube videos and read some rows on the web but nothing seemed to work. I recalled the files name, created a different and special directory for css files, saved and refreshed the pages.

ss from n

n ss

CodePudding user response:

Your current link is invalid and has no href to the CSS file path.

To properly link your styles:

<link rel="stylesheet" href="path-to-your-css-file.css">

CodePudding user response:

check this out: you did not mention the reference link to your style sheet

<head>
  <link rel="nofollow" href="STYLE SHEET LINK GOES HERE" type = "text/css">

Make sure where did you save your stylesheet and link it.

CodePudding user response:

To link the stylesheet with the html template, inside your tag in the html template link your stylesheets relative path(if you are using a local file) to the html file.

<link rel="stylesheet" href="relativepath to file.css">

If you are using external stylesheets

<link rel="stylesheet" href="path-to-your-css-file.css">

CodePudding user response:

<link rel="stylesheet" href="path">
// same folder

<link rel="stylesheet" href="./path">
// parent folder

<link rel="stylesheet" href="../path">
// for outer folder access external css file.

Check the folder you are accessing is right or you are doing in a wrong way.

  • Related