Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS Unused CSS Stages Flexbox and Multi-Column Layout Multi-Column Layout

1 Answer

-webkit- is one of many CSS “prefixes.”

Prefixes are used by web developers and browser vendors to test new CSS features. Many of the major modern web browsers have some prefixed CSS support, such as Firefox, Internet Explorer, Chrome, and Safari.

For example, here’s how you’d ensure a box-shadow displayed across different browsers:

element {
  /* -webkit- for Chrome, Safari, iOS, Android, Blackberry */
  -webkit-box-shadow: 0 1px 1px black;
  /* -moz- for Firefox */
  -moz-box-shadow: 0 1px 1px black;
  /* -ms- for Internet Explorer */
  -ms-box-shadow: 0 1px 1px black;
  /* -o- for Opera before version 15 */
  -o-box-shadow: 0 1px 1px black;

  /* And finally, no prefix for modern browsers */
  box-shadow: 0 1px 1px black;

Browser vendors—the people making Chrome, Firefox, etc.—encourage people not to publish prefixed CSS properties to live websites, because they’re for special features of CSS that may not be supported in the future, but most of the time, these features make it all the way to unprefixed support.