"Hello, World!" in CSS

#hello-world #css

Written by Anders Marzi Tornblad

How to do "Hello, World!" in CSS.

/* hello-world.css */ hello-world.css */
html::before {
    content: 'Hello, World!'
}

This is a very unorthodox use of CSS. Combined with an empty valid HTML document, this will produce an output in any browser. I made a pen for you.

For more "Hello, World!" examples, go to the Hello World category.