Iris Classon
Iris Classon - In Love with Code

Stupid Question 135: What are vendor-specific CSS property prefixes?

[To celebrate my first year of programming I will ask a ‘stupid’ questions daily on my blog for a year, to make sure I learn at least 365 new things during my second year as a developer]

A few posts ago I explained how you can use a grid to lay out a Windows Store App, with C# and XAML, and Html and JS. The Html and JS implementation uses vendor specific tags/properties for the css for Internet Explorer, the -ms-grid (read the article here: WinRT comparison JS/Html and C#/XAML: Using a grid for app layout ). I didn’t however explain what they are, so let’s do that.

vendor-specific CSS property prefixes explained

Those that make browsers are called vendors , definition of vendor is: One that sells or vends (vending is basically selling).
Vendors can extend the current CSS by adding their own stuff to it, basically like I would do with an extension method in C# or prototyping in JavaScript, category in Objective C and so. But it’s only their extension, and will only work in the browser they supply, and therefore we call these properties vendor specific. They all follow a specific naming convention that goes like this:

two words that start with a - (dash) or _ (underscore).

Here is an example: -ms-grid

Why this convention? This is to avoid naming conflicts between different vendors and the default CSS.

Comments

Leave a comment below, or by email.


Last modified on 2013-01-25

comments powered by Disqus