HTML Example:
<!DOCTYPE html>
<html>
<head>
<title>HTML Tutorial</title>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Try it Yourself<html>
<head>
<title>HTML Tutorial</title>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
CSS Example:
body {
background-color: lightblue;
}
h1 {
color: white;
text-align: center;
}
p {
font-family: verdana;
}
Try it Yourselfbackground-color: lightblue;
}
h1 {
color: white;
text-align: center;
}
p {
font-family: verdana;
}
JavaScript Example:
<button onclick="myFunction()">Click Me!</button>
<script>
function myFunction() {
let x = document.getElementById("demo");
x.style.fontSize = "25px";
x.style.color = "red";
}
</script>
<script>
function myFunction() {
let x = document.getElementById("demo");
x.style.fontSize = "25px";
x.style.color = "red";
}
</script>
Log in/ Sign Up
Create an account to track your progress, get your own website,
and get access to more features and learning materials:
Code Editor
With our online code editor, you can edit code and view the result in your browser


Try Frontend Editor (HTML/CSS/JS)
Try Backend Editor (Python/PHP/Java/C..)
W3Schools Spaces
If you want to create your own website, check outW3Schools Spaces.
No installation required - just open your browser and start coding:

Become a Plus User
And unlock powerful features:
Browse W3Schoolswithout ads
Build and host Websites
Unlimited challenges
Unlimited practice tests
Get extra credits
Priority support
For Teachers
Streamline your teaching:
Manage your classroom
Ready-to-use learning materials
Customize study plans
Track student progress
Interactive coding challenges
How To Section
Code snippets for HTML, CSS and JavaScript
For example, how to create a slideshow:
Learn How To



