Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google's crazy ID and class naming conventions

Tags:

css

gmail

I was just playing around with Firebug and editing Gmail's CSS file, and I wanted to edit a button, but the div ID for that button was :rj. I am fairly certain that CSS does not allow colons in —and especially starting as—ID and class names. So my guess is this is some advanced trickery. I'm not sure if it's consistent like this for each user, but FWIW, the ID was for the "Search Mail" button at the top of the page.

Does anyone know what they are doing and how they are doing it?

like image 951
redgem Avatar asked Jul 07 '11 20:07

redgem


1 Answers

IDs used to be quite strict on what was allowed, not so much for classes. HTML5, however, has lessened a lot of the restrictions on what could be ID values.

Here's an article on the what's allowed for IDs and classes in HTML5: http://mathiasbynens.be/notes/html5-id-class

It's enough to make your head hurt.

EDIT:

To address more of your question about why Google is using a seemingly random ID, I'm sure the IDs and classes they are using make perfect sense to their programmers.

like image 91
Brent Avatar answered Nov 08 '22 20:11

Brent