Convert Figma logo to code with AI

whatwg logohtml

HTML Standard

7,987
2,606
7,987
2,046

Top Related Projects

1,967

Deliverables of the HTML Working Group until October 2018

1,563

DOM Standard

Web Components specifications

4,878

Test suites for Web platform specs — including WHATWG, W3C, and others

CSS Working Group Editor Drafts

14,980

Status, process, and documents for ECMA-262

Quick Overview

The whatwg/html repository is the official home of the HTML Living Standard, maintained by the Web Hypertext Application Technology Working Group (WHATWG). This repository contains the source code for the HTML specification, which defines the core language of the World Wide Web: HTML.

Pros

  • Continuously updated and maintained, reflecting the latest web technologies and practices
  • Collaborative development process, allowing for community input and contributions
  • Comprehensive documentation of HTML features, including browser compatibility information
  • Serves as the authoritative reference for web developers and browser implementers

Cons

  • Can be overwhelming for beginners due to its technical nature and extensive content
  • Changes to the specification may take time to be implemented across all browsers
  • Some features described in the standard may not be widely supported or implemented
  • The living standard approach can make it challenging to reference specific versions of HTML

Getting Started

To contribute to or use the HTML Living Standard:

  1. Visit the official HTML Living Standard website: https://html.spec.whatwg.org/
  2. For contributions:
    • Fork the repository on GitHub
    • Make changes to the relevant files
    • Submit a pull request for review
  3. To report issues or suggest improvements:
    • Open an issue on the GitHub repository
    • Provide detailed information about the problem or suggestion
  4. To stay updated:
    • Watch the repository on GitHub
    • Follow the WHATWG on social media or join their mailing list

Note: This is not a code library, so there are no code examples or quick start instructions for implementation. The repository contains the specification itself, which is used as a reference for web developers and browser implementers.

Competitor Comparisons

1,967

Deliverables of the HTML Working Group until October 2018

Pros of html (w3c)

  • More structured and formal standardization process
  • Wider industry participation and consensus-driven approach
  • Clearer versioning and release cycles

Cons of html (w3c)

  • Slower update and release process
  • May lag behind in adopting cutting-edge features
  • Potentially more bureaucratic decision-making

Code Comparison

html (whatwg):

<script type="module">
  import { foo } from './module.js';
  foo();
</script>

html (w3c):

<script src="module.js"></script>
<script>
  foo();
</script>

The WHATWG version uses ES6 modules, while the W3C version uses traditional script loading. This reflects WHATWG's tendency to adopt newer features more quickly.

Both repositories aim to standardize HTML, but they differ in their approaches. WHATWG's html is a "living standard" that evolves continuously, while W3C's html follows a more traditional versioning model. WHATWG tends to be more agile and quick to adopt new features, while W3C focuses on broader consensus and formal processes. Developers often refer to both standards, as they complement each other in many ways.

1,563

DOM Standard

Pros of DOM

  • More focused and specific to DOM manipulation
  • Smaller codebase, potentially easier to understand and maintain
  • Provides a clear separation of concerns from HTML specification

Cons of DOM

  • Less comprehensive than the HTML specification
  • May require referencing HTML spec for full context in some cases
  • Potentially less frequent updates compared to HTML spec

Code Comparison

DOM (example of event handling):

document.addEventListener('click', function(event) {
  console.log('Clicked at:', event.clientX, event.clientY);
});

HTML (example of defining a custom element):

<script>
class MyElement extends HTMLElement {
  connectedCallback() {
    this.innerHTML = '<p>My custom element</p>';
  }
}
customElements.define('my-element', MyElement);
</script>
<my-element></my-element>

The DOM repository focuses on JavaScript APIs for manipulating document structure, while the HTML repository covers a broader range of web technologies and specifications. The DOM spec is more concise and targeted, making it easier to navigate for specific DOM-related information. However, the HTML spec provides a more comprehensive view of web standards, including DOM-related topics within its broader context.

Web Components specifications

Pros of webcomponents

  • Focused specifically on Web Components, providing a more specialized and in-depth resource
  • More active community involvement and contributions for Web Components-related topics
  • Faster iteration and experimentation with new Web Components features and ideas

Cons of webcomponents

  • Narrower scope compared to the comprehensive HTML specification
  • Potentially less stable or standardized, as it's a working group repository
  • May require additional context or knowledge of the broader HTML ecosystem

Code Comparison

html:

<div id="example">
  <p>This is a standard HTML element.</p>
</div>

webcomponents:

<custom-element>
  <p>This is a custom Web Component.</p>
</custom-element>

Summary

The html repository serves as the official specification for HTML, covering a wide range of topics and elements. In contrast, the webcomponents repository focuses specifically on Web Components technology, allowing for more specialized discussions and development. While html provides a comprehensive and stable reference, webcomponents offers a platform for innovation and experimentation in component-based web development. Developers should consider their specific needs when choosing which repository to refer to or contribute to.

4,878

Test suites for Web platform specs — including WHATWG, W3C, and others

Pros of wpt

  • Comprehensive test suite covering various web technologies
  • Collaborative effort with contributions from multiple browser vendors
  • Regularly updated to reflect the latest web standards

Cons of wpt

  • Larger repository size due to extensive test cases
  • May require more setup and configuration to run tests locally
  • Can be overwhelming for newcomers due to its broad scope

Code comparison

html:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>HTML Standard</title>
</head>

wpt:

<!DOCTYPE html>
<meta charset="utf-8">
<title>Example Test</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

Key differences

  • html focuses on defining the HTML standard, while wpt provides tests for various web technologies
  • html is primarily maintained by WHATWG, whereas wpt involves multiple stakeholders
  • wpt includes test infrastructure and utilities, while html contains the specification text
  • html repository is more focused and smaller in size compared to the extensive wpt repository
  • wpt is designed for cross-browser testing, while html serves as a reference for HTML implementation

Use cases

  • Use html when referring to the official HTML specification or contributing to its development
  • Use wpt when developing or testing web technologies across different browsers and platforms

CSS Working Group Editor Drafts

Pros of csswg-drafts

  • More comprehensive coverage of CSS specifications
  • Frequent updates and active development
  • Broader community involvement in the drafting process

Cons of csswg-drafts

  • Potentially more complex structure due to multiple CSS modules
  • May have a steeper learning curve for newcomers

Code Comparison

csswg-drafts:

@media (prefers-color-scheme: dark) {
  body {
    background-color: #333;
    color: #fff;
  }
}

html:

<picture>
  <source srcset="dark-image.jpg" media="(prefers-color-scheme: dark)">
  <img src="light-image.jpg" alt="Adaptive image">
</picture>

The csswg-drafts example showcases CSS media queries for dark mode, while the html example demonstrates HTML markup for responsive images. Both repositories contribute to web standards, but csswg-drafts focuses on styling and layout, whereas html covers broader HTML specifications.

csswg-drafts offers more detailed CSS-specific features and properties, making it ideal for developers working extensively with stylesheets. However, html provides a more holistic view of web document structure and semantics, which may be preferable for those seeking a comprehensive understanding of HTML elements and attributes.

14,980

Status, process, and documents for ECMA-262

Pros of ecma262

  • More frequent releases and updates, allowing for faster language evolution
  • Clearer contribution guidelines and process for proposing new features
  • Extensive test suite (Test262) for ensuring specification compliance

Cons of ecma262

  • Smaller community and fewer contributors compared to html
  • More complex specification, potentially harder for newcomers to understand
  • Narrower scope, focusing solely on JavaScript language features

Code Comparison

html:

<article>
  <h1>My First Article</h1>
  <p>This is a paragraph in HTML.</p>
</article>

ecma262:

class Article {
  constructor(title, content) {
    this.title = title;
    this.content = content;
  }
}

The html repository focuses on defining the structure and semantics of web documents, while ecma262 specifies the JavaScript language itself. The html example shows how to create a simple article structure, whereas the ecma262 example demonstrates a JavaScript class definition for an article object.

Both repositories are crucial for web development, with html providing the foundation for document structure and ecma262 defining the behavior of JavaScript, the primary programming language for web interactivity.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

This repository hosts the HTML Standard.

Code of conduct

We are committed to providing a friendly, safe and welcoming environment for all. Please read and respect the WHATWG Code of Conduct.

Contribution opportunities

We appreciate all contributions, see the guidelines for contributing for details, including information on how to build HTML output from the source file so you can preview your changes locally.

Tests

Tests are in the html/ directory of the web-platform-tests repository.

Blame

As the source file is too large for GitHub's blame utility, use blame for source on searchfox instead.