Hello, I've recently been learning html css and javascript. For some reason when I try to use javascript and CSS for the same webpage the CSS doesn't work.
Here's what I'm using as a script:
Only the button is visible, the background isn't red. Why is this happening?
Here's what I'm using as a script:
HTML:
<html>
<head>
<style type="text/css">
<link rel="stylesheet" type="text/css" href="thestyle.css"/>
body
{
background-color:red;
}
</style>
<script type="text/javascript">
function show_alert()
{
alert("Why do people always press the button they are told not to push?")
}
</script>
<title>Scorpia</title>
</head>
<body>
<input type="button" onclick="show_alert()" value="Do NOT press this button!"/>
</body>
</html>
Only the button is visible, the background isn't red. Why is this happening?
Last edited: