bcm811 Posted April 26, 2014 Report Posted April 26, 2014 Hello all, I've recently took it upon myself to refresh my memory of html and css. I have been doing the codeacademy exercises and have moved on to try to make my own simple webpage with css from raw code, without the help of a code editor, just doing it in text until I have the basic theory down. Here's my problem my CSS isn't linking up properly and displaying what it should, Please tell me what little bit of code I am missing so I can link these documents up in the future, please forgive the simplicity of my question, I hope to learn a lot here as I continue to progress. Here is my code: HTML (test.html): <!DOCTYPE html> <html> <link rel="stylesheet" href="testfiles/stylesheet.css" type="text/css"/> <head> </head> <body> <div id="weird"></div> <div class="meat">This is an example of my ".meat" class</div> <div class="potatoes">This is an example of my ".potatoes" class</div> <div class="image"><img alt="Brian wearing a cheap top hat in the summertime" src="file:///C:/Users/B/Desktop/Webpage/testfiles/tophat.jpg"/></div> </body> </html> CSS(stylesheet.css): <-- Stylesheet for Raw Code Webpage --> <style type="text/css> #weird { font-family:Serif; background-color:blue; font-color:aqua; font-size:1.5em; border:2px solid aqua; height:200px; width:1000px; #head2 { font-family:Arial,serif; background-color:blue; font-color:aqua; font-size:1.5em; border:2px solid aqua; height:200px; width:auto; } .meat { font-family:sans-serif; color:black; background-color:red; height:100px; width:auto; border:2px solid black; font-size:1.5em; } .potatoes { font-family:cursive; color:brown; background-color:tan; height:100px; width:auto; border:2px dashed brown; font-size:1.5em;} </style> ::::: END CODE ::: Quote
falkencreative Posted April 26, 2014 Report Posted April 26, 2014 A couple things that I immediately notice... -- You need to have the link to your stylesheet within the <head> section -- You don't need the <style> tags in the stylesheet. Because the styles are in a .css stylesheet, it's already clear that the content of the file is CSS. Hope that helps? Quote
kralcx Posted April 26, 2014 Report Posted April 26, 2014 (edited) Here is a link to your code; I think this is what you're looking for http://codepen.io/kralcx/pen/IwdKn Instead of stylesheet.css I used style.css and I removed your font-color and an extra html tag. Edited April 26, 2014 by kralcx Quote
bcm811 Posted April 27, 2014 Author Report Posted April 27, 2014 Thanks a lot for your help guys!!! That put things into perspective for me! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.