file in abyss
Back to formats

Web

CSS Cascading Style Sheets

Cascading Style Sheets is a web format commonly identified by .css. Use the listed signatures, MIME types, and structure notes to validate files beyond the extension.

Extensions .css
MIME text/css

Magic numbers

Analyze your file
offset 0 Cascading Style Sheets leading signature
3A 72 6F 6F 74
:root

Structure

  1. Selectors
  2. Declarations
  3. At-rules
  4. Custom properties

Caveats

  • Do not trust the extension alone. Check the MIME type, the first bytes such as 3A 72 6F 6F 74, and format-specific structure when possible.
  • Container formats and damaged files can share the same opening bytes, so deeper validation may be required for production upload, preview, or conversion flows.

Detection example

SIGNATURE = bytes.fromhex("3a726f6f74")
OFFSET = 0

def is_css(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

Practical usage

Use cases

Cascading Style Sheets is used for data exchange, imports, exports, parser testing, and validation workflows. Encoding, delimiters, versions, and container structure often change implementation behavior.

Common detection mistakes

  • The .css extension alone does not prove the file contents. Upload and conversion flows should combine extension, MIME type, leading bytes, and format-specific structure checks.
  • Cascading Style Sheets can start with signatures such as 3A 72 6F 6F 74, but related containers and damaged files may require additional validation.

Security notes

Untrusted input is not safe just because the format was detected. Account for parser exceptions, large files, unexpected encodings, and external references.

Using samples

11 samples help test leading-byte detection, parser errors, upload limits, and download behavior.

Sample files

11 / 11 files
Sample Traits Size Source / license / SHA-256
Web

Blue Sky CSS

Blue Sky CSS is a Cascading Style Sheets sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.css
Type Sample
Small file
244 B
SHA-256 b21610d64e082151dc6ed6e7fd77450273ea197fb932a44e482c672a2da94104
Download
Web

Flower Garden CSS

Flower Garden CSS is a Cascading Style Sheets sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.css
Type Sample
Small file
251 B
SHA-256 2b4049937e2555e3b406fd4044f7edf0e2c91a9cc6426dddeace122629fb8c1c
Download
Web

Navy Blue Sky CSS

Navy Blue Sky CSS is a Cascading Style Sheets sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.css
Type Sample
Small file
251 B
SHA-256 2e8a93482737980e961e069d7f29cbaf01fc59ba6e2522eadb31c2f377c21526
Download
Web

Nature of the Sky CSS

Nature of the Sky CSS is a Cascading Style Sheets sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.css
Type Sample
Small file
257 B
SHA-256 c8e6062864bb2217599509009a338f85ac5d02566748041eb62f754f51e53a98
Download
Web

Sky Landscape CSS

Sky Landscape CSS is a Cascading Style Sheets sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.css
Type Sample
Small file
253 B
SHA-256 ea49ce1bcb735e7455d02c353cc714dcd2e818c396f78822b369a6e12dc6aad2
Download
Web

Starry Sky CSS

Starry Sky CSS is a Cascading Style Sheets sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

06-starry-sky.css
Type Sample
Small file
250 B
SHA-256 2ad5ab74d78a3d2ad64dcadf71ce84bbb9441b725ed1567729621c02f1f0eff2
Download
Web

Blue Night Sky CSS

Blue Night Sky CSS is a Cascading Style Sheets sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.css
Type Sample
Small file
254 B
SHA-256 d86e9bfcb4e2222f00bfe6f4da35ac36c71010b54c27f781e30aa010c5682182
Download
Web

Hibiscus Flower CSS

Hibiscus Flower CSS is a Cascading Style Sheets sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

08-hibiscus-flower.css
Type Sample
Small file
255 B
SHA-256 02502ed584ef0a1ac98ddef81ca2790a25f59d0a0dce93a17f217f64822b7116
Download
Web

Arctic Sky CSS

Arctic Sky CSS is a Cascading Style Sheets sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

09-arctic-sky.css
Type Sample
Small file
250 B
SHA-256 24134d3d61947d2d723d194ea3d15bd4fa3c833f35c4b742bb9373c5aad0915e
Download
Web

Sunset Rays CSS

Sunset Rays CSS is a Cascading Style Sheets sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

10-sunset-rays.css
Type Sample
Small file
251 B
SHA-256 0910c9d5df680cc91dffa4eb06c9c3adab01be40d5207cc27a5bcef622f27260
Download
Web

NASA Blue Marble CSS

NASA Blue Marble CSS is a Cascading Style Sheets sample based on NASA Image and Video Library. It can be used to test downloads, parsers, previews, and file type detection.

nasa-blue-marble-2012-east.css
Type Sample
Small file
264 B
SHA-256 87fbbe9ca50740d45f6bea5c1672b5c1ecb728c9291f20eb57641e07a5afc6fd
Download

Frequently asked questions

What is the magic number (file signature) of Cascading Style Sheets?

Cascading Style Sheets files begin with the byte signature 3A 72 6F 6F 74 (":root"). Detect the format by reading these leading bytes rather than trusting the file extension alone.

What is the MIME type of Cascading Style Sheets?

The MIME type for Cascading Style Sheets is text/css.

What file extension does Cascading Style Sheets use?

Cascading Style Sheets files use the .css extension. The extension is a convention only and does not guarantee the file contents, so combine it with signature and structure checks.

Related formats