So I am reading a book called <<teach yourself CSS and HTML in 24 hours>>, when it comes to CSS the book asks readers to edit a style sheet in a separate .css file and put a link in the html file to link to the .css file. I did it but it does not work.
Then I watched a video clip on youtube that says I can simply add a <style> tag in my html file to make css work and i succeed.
The problem is I want to do this in the way that the book taught me because I think that will make my file easier to read for my own sake.
here is my code for html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head><title>Hello</title></head>
<link rel="stylesheet" type="text/css" href="mycss.css" />
<body>
<p>Hi my name is chris</p>
</body>
</html>
here is my code for mycss.css:
p {
color:green;
font-family:arial;
}
however if i write it in this way, it works:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head><title>Hello</title></head>
<style type="text/css">
p {color:green; font-family:arial;}
</style>
<body>
<p>Hi my name is chris</p>
</body>
</html>