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

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.

CSS3

CSS Scroll-Driven Animations

Learn CSS scroll-driven animations with scroll and view timelines, animation ranges, accessible fallbacks, and a runnable progress indicator example.

Java Programming

Java Sealed Classes

Learn Java sealed classes and interfaces with permits, final, sealed, and non-sealed subclasses, package rules, reflection, and practical examples.

MySQL

MySQL JSON_TABLE Function

Learn MySQL JSON_TABLE to convert JSON arrays and objects into relational rows with typed columns, ordinality, nested paths, and error handling.

HTML5

HTML Invoker Commands

Learn HTML Invoker Commands to control dialogs and popovers declaratively with command and commandfor, including custom commands and accessible examples.

CSS3

CSS Anchor Positioning

Learn CSS anchor positioning with named anchors, position-area, anchor functions, sizing, fallbacks, and a complete responsive example.

MySQL

MySQL Window Functions

Learn MySQL window functions with OVER, PARTITION BY, ordering, frames, ranking, running totals, LAG, LEAD, and named windows.