Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
PRATIK TALREJA
1,971 Pointslinking css to html
i am not able to link css to html file. What can be possible reasons? console log shows that its is unable to find css file,though i have linked my css file correctly,
<link rel="stylsheet"href="css/normalize.css"> <link rel="stylesheet" href="css/main.css">
2 Answers
doesitmatter
12,885 PointsLinking a CSS file consists of 3 parts:
<link rel="stylesheet" type="text/css" href="style.css">
- The
relattribute specifies the relation of the current document to the linked one. - The
typeattribute specifies the type of file which is linked. -
hrefpoints to the file.
You have forgotten to mention the type. But I don't think this is what causes the issue here, can you share your code with us?
doesitmatter
12,885 PointsI can't open the workspace link you posted (page does not exist) :/
But the HTML looks fine, so problem isn't there.
Have you tried putting something like:
*{
color : red;
}
in your css code to see if it is linked?
PRATIK TALREJA
1,971 PointsPRATIK TALREJA
1,971 Pointshttps://teamtreehouse.com/workspaces/28777092
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>PRATIK TALREJA|DEVELOPER</title> <link rel="stylsheet"href="css/normalize.css"> <link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=PT+Sans|Raleway" rel="stylesheet"> <link rel="stylesheet" href="css/main.css"> </head> <body> <header> <a href="index.html" id="logo"> <h1>Pratik Talreja</h1> <h2>Developer</h2> </a> </header> <nav> <ul > <li><a href="index.html" class="selected">Portflio</a></li> <li><a href="about.html">About</a></li> <li><a href="contact.html">Contact</a></li> </ul> </nav> <p></p> <ul id="content"><li> <p>Hello.I am Pratik Talreja. This is my first attempt of making a website on my own.In this webpage you will get to see some of my pictures and my contact links.
<footer id="f"> <ul>
<li><p><a href="https://www.facebook.com/pratik.talreja.3"><img src="facebook.png" alt"facebook-logo"></a></p></li>
<li><p><a href="https://www.instagram.com/talreja_pratik/"><img src="insta.png" alt"instagram-logo"></a></p></li> <p>©2017|PratikTalreja</p>
</body> </html>