file in abyss
フォーマット一覧へ戻る

Web

CSS Cascading Style Sheets

Webページの見た目を定義するスタイルシート。固定のバイナリシグネチャはありません。

Extensions .css
MIME text/css

マジックナンバー

ファイルを解析
オフセット 0 このサイトのCSSサンプルで使うルートセレクタ
3A 72 6F 6F 74
:root

構造

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

注意点

  • CSS一般には固定マジックナンバーがなく、内容解析やMIMEタイプと組み合わせて判定します。

判定コード例

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

実践的な使い方

ユースケース

Cascading Style Sheets はデータ交換、インポート/エクスポート、パーサのテスト、検証ワークフローで使われます。エンコーディング・区切り文字・バージョン・コンテナ構造が実装の挙動を変えることがあります。

よくある判定ミス

  • .css という拡張子だけではファイルの中身を保証できません。アップロードや変換の処理では、拡張子・MIMEタイプ・先頭バイト・形式固有の構造チェックを組み合わせるべきです。
  • Cascading Style Sheets は 3A 72 6F 6F 74 のようなシグネチャで始まりますが、関連するコンテナや破損ファイルでは追加の検証が必要になる場合があります。

セキュリティ上の注意

形式が判定できたからといって、信頼できない入力が安全とは限りません。パーサ例外・巨大ファイル・想定外のエンコーディング・外部参照を考慮してください。

サンプルの活用

11 個のサンプルで、先頭バイト判定・パーサのエラー・アップロード上限・ダウンロード挙動をテストできます。

サンプルファイル

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

よくある質問

Cascading Style Sheets のマジックナンバー(ファイルシグネチャ)は?

Cascading Style Sheets ファイルはバイトシグネチャ 3A 72 6F 6F 74 (":root") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。

Cascading Style Sheets のMIMEタイプは?

Cascading Style Sheets のMIMEタイプは text/css です。

Cascading Style Sheets の拡張子は?

Cascading Style Sheets ファイルは .css 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。

関連フォーマット