+ 1
How to fix the black / white screen when I use html/css/js???
I reinstalled btw
2 Réponses
+ 1
Blank screen almost always means thereâs an error in your code or missing file links. Hereâs minimal working template you can copy every time to avoid blank screens:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Test Page</title>
<style>
body {
background-color: #f4f4f4;
font-family: Arial, sans-serif;
text-align: center;
margin-top: 50px;
}
h1 {
color: #333;
}
</style>
</head>
<body>
<h1>Hello World</h1>
<p>If you see this, everything is working!</p>
<script>
// Simple JS test
console.log("JS is working!");
alert("JavaScript is running");
</script>
</body>
</html>
If this loads fine but your code shows a blank screen - add your CSS in the <style> section (or link a file), add your JavaScript inside the <script> tags (or link a file), and test step by step.
<!-- put CSS in the head -->
<link rel="stylesheet" href="style.css">
<!-- put scripts just before </body> -->
<script src="script.js"></script>
Good Luck!
0
Thx a lot man