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:
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:
Your problem was with your JavaScript and you should not be using the FONT element.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Tester</title>
<link rel="stylesheet" type="text/css" href="tstyle.css">
<script language="JavaScript">
questionOne = prompt("25+56=","");
</script>
</head>
<body>
<h1>Mathematics Quiz</h1>
<script type="text/javascript">
if (questionOne == 25+56) {
document.write ('<p class="one">25+56 = ', questionOne, ' You are totally correct!<\/p>');
} else {
document.write ('<p class="two">25+56 = ', questionOne, ' ...Oh Dear!, The correct Answer is ', 25 + 56, '<\/p>');
}
</script>
</body>
</html>
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
Thanks it works! Can I ask you charles to please delete your post or edit it so there is no code, it is quite important that you do so.
Thanks in advance.
Absolutely not. If you have committed academic dishonesty then you'll just have to take what you get. When I was in school one instance of any kind of cheating meant expulsion.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
May I say, it wasn't cheating, as I gave you my code to see where my mistakes lie, and to ask for help in how to correct the problem, so the answers actually do display, instead of not showing up at all. I do however, thank you for your help, as it has solved the problem.
Bookmarks