Linking html and css pages

I’m working on the off platform project Dasmoto’s Arts & Crafts. I’m trying to link the html and css pages. The html file is labeled art.html. The css file is labeled art.css.

I can’t seem to link the html and css files. Below is my code:

<html> <head> <link href="./resources/css/index.css" type="text/css" rel="stylesheet"> <title>Dasmato's Arts and Crafts</title> </head> <body> <h1>Dasmato's Arts and Crafts</h1> <link href="./resources/css/index.css" type="text/css" rel="stylesheet"> <p style="background-image:image(image2);"> </body> </html>
<link href="./resources/css/index.css" type="text/css" rel="stylesheet">
<title>Dasmato's Arts and Crafts</title> 

Dasmato's Arts and Crafts

Can you send a screenshot of the file system, please? Also, you shouldn’t have a <link> tag in the body; I would remove that (it might be causing some weird things to happen…)

I’ve removed the link tag. Below is the path to the css file:

file:///home/chronos/u-07dc99f646fe11b07e906c8ef86467555f047b2a/MyFiles/Downloads/projects/css/art.css

It seems that those two paths don’t match; you’ve got resources/css in the file path in your code. What is the link to the HTML file?

The link for the html file is:

file:///home/chronos/u-07dc99f646fe11b07e906c8ef86467555f047b2a/MyFiles/Downloads/projects/arts.html

Perhaps try css/art.css as the value for the href attribute. Either that or ./css/art.css.

1 Like

Got it. I was able to get things working.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.