L
Larry Lindstrom
Hi Folks:
I've done some CGI scripts, written in C++, about 10 years ago, but
haven't done any web related projects since. I want to get familiar
with web applications again.
To that end, I've loaded Apache on a PC running OpenSolaris so I
have a captive web host.
On my account I have the "Main" web page at
~/www/site.learn_html_htmldog/htdocs/index.html
This HTML file has a list with links to HTML files arranged in sub-
directories of htdocs.
I'm working through HTMLDog's tutorial, just starting the beginning
CSS at:
http://htmldog.com/guides/cssbeginner/applyingcss/
Files for this example are located at:
~/www/site.learn_html_htmldog/htdocs/css_beginner_tutorial/
applying_css
The first example is of an internal CSS, and works fine.
The next example is a separate CSS file, which looks like this:
----
p {
color: red;
}
a {
color: blue;
}
----
Should CSS files have a prologue? This example doesn't.
So I follow the text and create a file by this name and save it as
"web.css" in the applying_css directory, along with:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>My first web page</title>
<link rel="stylesheet" type="text/css" href="web.css" />
</head>
<body>
<h4>This uses an external stylesheet to set paragraphs and
anchors.</h4>
<p>This is a paragraph</p>
<a href="link_file.html">Link</a>
</body>
</html>
When I select this HTML, the CSS seems to be ignored, the paragraph
is displayed as black and the anchor is displayed as blue.
I've tried moving the CSS file to the htdocs directory, with no
effect.
What am I doing wrong?
Thanks
Larry
I've done some CGI scripts, written in C++, about 10 years ago, but
haven't done any web related projects since. I want to get familiar
with web applications again.
To that end, I've loaded Apache on a PC running OpenSolaris so I
have a captive web host.
On my account I have the "Main" web page at
~/www/site.learn_html_htmldog/htdocs/index.html
This HTML file has a list with links to HTML files arranged in sub-
directories of htdocs.
I'm working through HTMLDog's tutorial, just starting the beginning
CSS at:
http://htmldog.com/guides/cssbeginner/applyingcss/
Files for this example are located at:
~/www/site.learn_html_htmldog/htdocs/css_beginner_tutorial/
applying_css
The first example is of an internal CSS, and works fine.
The next example is a separate CSS file, which looks like this:
----
p {
color: red;
}
a {
color: blue;
}
----
Should CSS files have a prologue? This example doesn't.
So I follow the text and create a file by this name and save it as
"web.css" in the applying_css directory, along with:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>My first web page</title>
<link rel="stylesheet" type="text/css" href="web.css" />
</head>
<body>
<h4>This uses an external stylesheet to set paragraphs and
anchors.</h4>
<p>This is a paragraph</p>
<a href="link_file.html">Link</a>
</body>
</html>
When I select this HTML, the CSS seems to be ignored, the paragraph
is displayed as black and the anchor is displayed as blue.
I've tried moving the CSS file to the htdocs directory, with no
effect.
What am I doing wrong?
Thanks
Larry