Hi
I am having a little problem with my external style sheet. I am quite sure I have written it correctly, but I am having trouble with the paragraph styles in my external css style sheet. My code for my style sheet is shown below:
[CODE]
body {background-color:b0c4de;
color:#000000;
font-family: Arial, sans-serif, Helvetica
}
h1 {color:#000099;
font-style:bold;
font-family:Arial
}
p.1 {font-style:normal;}
p.2 {font-style:oblique;}
I have inserted the link into my html file linking it to the external style sheet, but need to know why the paragraphs are not displaying hwo they should. Currently, I have a user who answers 10 questions, then they are displayed on screen (from javascripting), but the problem is they are not showing. I have used the class=”1″, and class=”2″, but it is not displaying and all I get is a blank screen except for the background colour and <h1>. A little example of my code is shown below:
[CODE]
<html>
<head>
<title>Tester</title>
<link rel=”stylesheet” type=”text/css” href=”tstyle.css” />
<script language=”JavaScript”>
var questionOne = prompt(“25+56=”,””);
</script>
</head>
<body>
<h1>Mathematics Quiz</h1>
<script language=”JavaScript”>
if(answer1 == 25+56)
{
document.write(“<p class=”1”><font color=’green’>25+56 = “+questionOne+” You are totally correct!</font></p>”);
}
else
{
document.write(“<p class=”2″><font color=’red’>25+56 = ” +questionOne +” …Oh Dear!, The correct Answer is ” + (25+56) +”</font></p>”);
}
</script>
</body>
</html>
Any ideas on why the paragraphs are not displaying when the user has finished the quiz and the answers are displayed?
Thanks if you can help.