This page demonstrates the power of CssUserAgent. This feature applies User-Agent specific CSS classes to the <body> tag to allow browser-specific CSS variation without resorting to CSS hacks. Since these are performed once at startup, CSS may be statically defined without the need to mix browser-specific logic into the presentation.

Multiple classes are created for each user-agent, allowing the web developer to target browser classes on differing levels of granularity. The general pattern is browser name followed by version number:

  • ua-browsername
  • ua-browsername-major
  • ua-browsername-major-minor
  • ua-browsername-major-minor-build
  • ua-browsername-major-minor-build-revision

Some browsers have multiple listings if the rendering engine is significant. For instance, Gecko-based browsers (such as Firefox, Mozilla, Netscape, Camino, SeaMonkey) also define Gecko CSS classes, to target all browsers of a specific Gecko version at once.

Below is an example of a number of browser labels which display differently under the presence of different CssUserAgent classes.

  • Gecko
  • Gecko 1.7
  • Gecko 1.8
  • Gecko 1.9
  • Gecko 2
  • Firefox
  • Firefox 1.x
  • Firefox 1.0
  • Firefox 1.5
  • Firefox 2.x
  • Firefox 3.x
  • Firefox 3.0.x
  • Firefox 3.1
  • Firefox 3.5.x
  • Firefox 3.6.x
  • SeaMonkey
  • SeaMonkey 1.x
  • SeaMonkey 1.1
  • Netscape
  • Netscape 5.x
  • Netscape 6.x
  • Netscape 7.x
  • Netscape 7.2
  • Netscape 8.x
  • Netscape 9.x
  • Safari
  • Safari 1.x (85.x)
  • Safari 2.x (419.x)
  • Safari 2.0.4 (419.3)
  • Safari (522.x)
  • Safari 3.0 (523.x)
  • Safari 3.1 (525.21)
  • Safari 3.2 (525.27)
  • Safari 4.0 (526.x)
  • Safari 4.0 (530.17)
  • Apple Webkit
  • Apple Webkit 419.x
  • Apple Webkit Nightly 420.x
  • Apple Webkit 525.x
  • Apple Webkit 525.27.1
  • Apple Webkit 530.x
  • Apple Webkit 532.x
  • Chrome
  • Chrome 0.2.x
  • Chrome 1.x
  • Chrome 2.x
  • Chrome 3.0.201.x
  • Chrome 4.0.x
  • Chrome 4.0.249.89
  • Chrome 5.x
  • Internet Explorer
  • Internet Explorer 5.x
  • Internet Explorer 5.0
  • Internet Explorer 5.5
  • Internet Explorer 6.x
  • Internet Explorer 7.x
  • Internet Explorer 8.x
  • Internet Explorer 9.x
  • Opera
  • Opera 7.x
  • Opera 8.x
  • Opera 9.x
  • Opera 9.52
  • iCab
  • iCab 2.x
  • iCab 3.x
  • iCab 4.x
  • Camino
  • Camino 1.x