5

Why gmail buttons is "div" tag and not "button" tag?

The gmail button code from chrome firebug:

<div id=":or" class="T-I J-J5-Ji ar7 T-I-ax7 L3 T-I-JO" role="button" tabindex="0" aria-expanded="false" style="-webkit-user-select: none; " aria-haspopup="true">
 <span class="Ykrj7b">More</span>
 <div class="G-asx T-I-J3 J-J5-Ji"></div>
</div>

Thanks in advance, Yosef

Ben
  • 25,389
  • 34
  • 109
  • 165

3 Answers3

5

Most likely for compatibility.

Internet Explorer 6 and 7 seem to be adding their own padding to button elements. Also, there seem to be width issues with button elements in those browsers when applying styles to them.

Community
  • 1
  • 1
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
  • I wouldn't of thought it was this, as Google only support IE8+ at present (http://support.google.com/mail/bin/answer.py?hl=en&answer=6557) and indeed tend to go down the line of "upgrade your browser" to users of non-standards-compliant browsers. – isNaN1247 Dec 11 '11 at 18:41
4

I would assume its Google going to insane depths over performance, as behind the scenes the button element has one of the longer trips through the WebKit stack.

As shown in this video by Alex Russell.

isNaN1247
  • 17,793
  • 12
  • 71
  • 118
-1

Google is famous for this. They use tables in a lot of their layouts too.

Does it really matter how they do it? Gmail seems to be pretty successful despite the fact that this is not the way the W3C says it should be done.

danludwig
  • 46,965
  • 25
  • 159
  • 237