Skip to content

ウェブサービスの body 要素に出力されている id と class まとめ #56

@shikakun

Description

@shikakun

スタイルシートを書くとき、こういうページにだけ適用したいということがある。HTML 中にインラインで書くのは論外として、HTML の body 要素にそのページの役割を示す id なり class なりが割り振られていれば便利そうだな〜と思って他の有名どころのサイトのソースを見たら body 要素にきちんと書かれていることが多かった。

というわけで、ログイン状態でそれぞれのサービスのトップページ(ダッシュボード的な役割のページ)を見たときに body 要素に出力されていた id 属性と class 属性をまとめました。

GitHub

idなし
classlogged_in env-production macintosh page-dashboard

Twitter

idなし
classt1 logged-in user-style-shikakun rosetta enhanced-mini-profile

Facebook

idなし
classhasLeftCol home composerExpanded fbx gecko mac Locale_ja_JP

Google+

idなし
classTd lj

Tumblr

iddashboard_index
classdashboard_index logged_in with_auto_paginate is_dashboard layout_standard

クックパッド

idなし
classpc top_controller top_action

はてなブックマーク

idなし
classglobal-index media-page

はてなブログ

idなし
classpage-index

page-index とかだけでも良いけど、クックパッドとか見るに controller 名と action 名を出力するようにしてるとだいたいカバーできそうだなあ。
あとはログイン状態とか、ブラウザ名とか、UA とか、言語とか、本番環境か開発環境か、とかあると便利かな?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions