W3schools Tutorials & Courses

Learn programming for free with our latest online learning resources with simple examples.

Learn How to Code

<!DOCTYPE html>
<html>
  <head>
    <title>Webpage Title</title>
  </head>
  <body>
    <h1>Main Heading</h1>
    <p>A paragraph text.</p>
  </body>
</html>
body {
  background-color: #FFF; 
  font-size: 16px;
}
h1 {
  font-size: 2rem;
}
p {
  font-family: Verdana,sans-serif;
}
<button onclick="demoFunc()">Click Me!</button>
<script>
  function demoFunc() {
    let p = document.getElementById("p");
    p.textContent = "You changed this text!";
    p.style.fontSize = "20px";
    p.style.color = "blue";
  }
</script>

Express.js

Web Framework

Learn to build fast and scalable server-side applications with Node.js.

const express = require('express');
const app = express();

app.get('/', (req, res) => {
  res.send('Hello Express.js!');
});

app.listen(3000, () => {
  console.log('Server running on port 3000');
});
<?php
echo "Hello, I'm a PHP script!";
function demoFunc()
{
  echo "It works.";
  echo "Today's date is " . date('Y-m-d');
  echo "Have a great day!";
}
demoFunc();
?>
-- Retrieve active users
SELECT userID, 
       CONCAT(firstName, ' ', lastName) AS name, 
       email,
       registrationDate
FROM users
WHERE status = 1;
-- End of query
-- Output: userID, name, email, registrationDate
def greet():
  return '''Welcome to Python!
It's easy to learn.'''

message = greet()
print(message)
public class Greet {
  static String greet() {
    return "Welcome to Java!";
  }

  public static void main(String[] args) {
    System.out.println(greet());
    System.out.println("It's easy to learn.");
  }
}

JSP

Web Technology

Learn to build dynamic web content with Java integration.

<%@ page contentType="text/html; charset=UTF-8"%>
<html>
<head>
  <title>Quick JSP Demo</title>
</head>
<body>
  <p>Hello, I'm a JSP script!</p>
  <% out.println("Today's date is " + new java.util.Date()); %>
</body>
</html>
#include<stdio.h>

int main()
{
  printf("First C Program.\n");
  return 0;
}
#include <iostream> 

int main()
{
 std::cout<<"First C++ Program.";
 std::cout<<std::endl<<"Its easy to learn.";
}
{
  "user": {
    "name": "User name",
    "active": true
  }
<user>
  <name>User name</name>
  <active>true</active>
</user>

New & Trending Tutorials

Python Programming

Python tomllib

Learn Python tomllib to read TOML configuration files, handle types and errors, and parse decimal values safely with practical examples.

PHP 8

PHP Property Hooks

Learn PHP property hooks to validate, normalize, and compute object properties with practical PHP 8.4+ examples and clear restrictions.

GIT

Git Worktree

Learn Git worktree to work on multiple branches at once, manage linked working trees safely, and avoid repeated clones with practical commands.

CSS3

CSS field-sizing

Learn CSS field-sizing to create inputs and text areas that adapt to their content, with constraints, fallbacks, and a runnable example.

HTML5

HTML Search Element

Learn the HTML search element to build semantic site searches and filters with accessible forms, JavaScript examples, and best practices.

Docker

Docker Build Checks

Learn Docker build checks to validate Dockerfiles, understand rule violations, fail CI builds, skip checks safely, and test build targets.

Laravel

Laravel Context

Learn Laravel Context to share request metadata with logs and queued jobs using values, stacks, hidden context, and temporary scopes.

HTML5

HTML Hidden Until Found

Learn HTML hidden until found to create searchable collapsed content with fragment links, beforematch events, fallbacks, and examples.

Docker

Docker Compose Watch

Learn Docker Compose Watch to sync files, rebuild images, restart services, configure ignore rules, and improve container development.

CSS3

CSS @scope At-Rule

Learn CSS @scope to contain component styles, define scope roots and limits, use :scope, handle proximity, and add compatible fallbacks.

MySQL

MySQL Generated Columns

Learn MySQL generated columns to compute values from expressions using virtual and stored columns, indexes, and practical examples.

HTML5

HTML Dialog Element

Learn HTML dialog element to create native modal and non-modal dialogs with show(), showModal(), close(), forms, and examples.

CSS3

CSS :has() Selector

Learn CSS :has() selector to style parent elements based on child content, form state, and nearby elements with clear examples.