|Basic CSS/HTML StyleSheet Linking Trouble Shooting HElp?|
| 11:53 pm on Aug 9, 2011 (gmt 0)|
Basic CSS/HTML StyleSheet Linking Trouble Shooting Please Help?
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//WSC//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<link rel="stylesheet" type="text/css" href="stylesheetcss.css" />
<h1> Basic CSS Font Properties</h1>
<p>The following table shows you the basic CSS font properties that allow
you to change the appearance of text in your documents.</p>
<td>Specifies the font used</td>
<td>Specifies the size of the font used</td>
<td>Specifies whether the font should be normal, italic or oblique</td>
<td>Specifies whether the font should be normal, bold, bolder, or lighter</td>
And for my Style Sheet I have this but its not working and its in the same directory
font-family:arial, verdana, sans-serif; }
For some reason on the .html page the second row for my tables is not showing up and whateve I do cant fix it plus my CSS is not linking up and ive tried many things to no avail could someone please point me in the right direction
| 12:46 am on Aug 10, 2011 (gmt 0)|
font-family: arial, verdana, sans-serif;
You need '#' before the color values.
| 12:57 am on Aug 10, 2011 (gmt 0)|
Start with the embarrassingly obvious. Is your stylesheet in fact named stylesheetcss.css ? Is it only the color names that aren't coming through, or also the other properties? What about the rest of the CSS? You've got a class = "code" that you didn't include in your example.
Color names in the format you've used need a leading # or they will not be recognized.
Most important: Your DTD is in the wrong form. Feed it into the validator as a direct paste-in (I filled in the missing line as ... "DTD/xhtml1-strict.dtd"> ) and it will spit out 30 errors, most of them fixable by a single change.
Throw out the xml line, which you don't need, and replace the next few lines with
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns = "http://www.w3.org/1999/xhtml">
<meta http-equiv = "Content-Type" content = "text/html; charset=UTF-8" />
and the validator will be much happier.
When you say "second row" do you mean the first non-header row, or the second row of ordinary cells? Does it do this in all browsers?
| 5:47 am on Aug 10, 2011 (gmt 0)|
Also, don't use relative page links to your stylesheet, use root relative or absolute URLs.
That is, begin the link with a leading slash and specify the full path to the file, or begin the link with http and specify the domain name and full path to the file.
You'll appreciate why this is important once you start to use URL rewriting for HTML pages.
| 5:06 pm on Aug 10, 2011 (gmt 0)|
Is this what's actually in the document?
<!DOCTYPE html PUBLIC "-//WSC//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-…
It's an incomplete document declaration. Should be
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Don't know why that would have any effect on the table rows, they look fine.