Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Plain black webpage

+3
−0

This is a language specific challenge, for HTML only.

Your answer is the content of a self contained HTML file, that when opened in a web browser gives a plain black page.

Requirements

  • The HTML file is self contained.
    You may use CSS, JS, WASM, or images only if they are contained within the HTML file, not referenced as separate locations such as files or web addresses.
  • The entire page is black.
    The red, green, and blue components of every pixel are zero.
  • The page works in at least one freely available browser.
    Here freely available means it can be legally installed free of charge on an operating system that does not cost money. This ensures answers can be tested without needing to spend money on a browser or operating system.
  • The page works regardless of the default background colour of the browser.

Scoring

This is a code golf challenge. Your score is the number of bytes in the HTML file. Lowest score wins.

Explanations are optional, but I'm more likely to upvote answers that have one.

History
Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

4 answers

+3
−0

HTML, 16 bytes

<body bgcolor=0>

an attribute that works well for this challenge. tested on Mozilla Firefox.

-3 from [Object object]

History
Why does this post require moderator attention?
You might want to add some details to your flag.

1 comment thread

<body bgcolor=0> (1 comment)
+1
−0

HTML, 25 bytes

<style>*{background:#000}

Not really sure if this is a legal solution, but technically you can open it in your browser...

History
Why does this post require moderator attention?
You might want to add some details to your flag.

1 comment thread

Perfectly valid (1 comment)
+1
−0

HTML, 28 Bytes

<HTML style=background:#000>

#000 is shorter than black and quote marks are officially required but browsers figure it out.

History
Why does this post require moderator attention?
You might want to add some details to your flag.

0 comment threads

+1
−0

HTML, 31 Bytes

<HTML style="background:black">

The best solution is frequently the easiest one.

History
Why does this post require moderator attention?
You might want to add some details to your flag.

1 comment thread

Bold claim... (1 comment)

Sign up to answer this question »