DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Subtitles: The Good, the Bad, and the Resource-Heavy
  • Loader Animations Using Anime.js
  • Next.js Theming: CSS Variables for Adaptive Data Visualization
  • Creating Scrolling Text With HTML, CSS, and JavaScript

Trending

  • AI's Dilemma: When to Retrain and When to Unlearn?
  • How To Replicate Oracle Data to BigQuery With Google Cloud Datastream
  • Why We Still Struggle With Manual Test Execution in 2025
  • Scalable System Design: Core Concepts for Building Reliable Software
  1. DZone
  2. Coding
  3. Languages
  4. Understanding CSS Vendor Prefixes

Understanding CSS Vendor Prefixes

Ever wondered about what -moz- or -webkit- markings in CSS mean? In this post, we tackle the issues of CSS vendor prefixes and show you how to use them.

By 
Tatjana Boskovic user avatar
Tatjana Boskovic
·
Jun. 11, 18 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
14.2K Views

Join the DZone community and get the full member experience.

Join For Free

Have you ever wondered about what -moz- or -webkit- markings in CSS mean? Well, if you have, you are in the right place! Those markings are called vendor prefixes.

About Vendor Prefixes

Let's answer the question: What are vendor prefixes? Simply put, vendor prefixes are a way for your browser to support new CSS features before they become fully supported in all browsers.

When CSS3 became popular, all sorts of new features started appearing. Unfortunately, not all of them were supported across all browsers. Vendor prefixes helped developers use those new features, and have them supported instantly without having to wait for each of them to become available for every browser.

Vendor prefixes are not a hack, and you should feel free to use them.

A good way to check which property is available to use without a vendor prefix is by checking the CanIUse service. There you can see which browser currently supports which property.

The Prefixes

Major browsers use the following prefixes:

  • -webkit- Chrome, Safari, newer versions of Opera, almost all iOS browsers.
  • -moz- Firefox.
  • -o- Old versions of Opera.
  • -ms- Microsoft Edge and Internet Explorer.

When using vendor prefixes, keep in mind that they are only temporary. A lot of properties that needed to have vendor prefixes attached to them are now fully supported and don't need them.

How Should You Use Them?

You can easily use vendor prefixes, simply by adding them before the property, like this:

.element {
  -webkit-transform: rotate(60deg);
  -ms-transform: rotate(60deg);
  -o-transform: rotate(60deg);
  transform: rotate(60deg);
}

In this case, you ensure the property is supported in browsers.

It is a good practice to put the unprefixed property at the bottom. This way, by using the cascading nature of CSS, you ensure that when the property is fully supported, this is the one it will use.

Which Property Needs Prefixing?

This is a frequently asked question. A good thing would be to stop guessing and check out these websites:

  • http://shouldiprefix.com/
  • https://www.w3.org/TR/css-2010/#properties

Tired of Writing Prefixes?

If you are tired of writing prefixes every time you need one, there are a couple of autoprefix services that can help you:

  • https://github.com/postcss/autoprefixer - PostCSS plugin
  • https://www.npmjs.com/package/autoprefixer - npm prefixor
  • https://github.com/sindresorhus/sublime-autoprefixer - for Sublime text

Conclusion

Hopefully, this short introduction to vendor prefixes helped you to understand them more, and fear them less. Make sure to use them correctly in your new projects, and remember: vendor prefixes are our friends!

CSS

Published at DZone with permission of Tatjana Boskovic, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Subtitles: The Good, the Bad, and the Resource-Heavy
  • Loader Animations Using Anime.js
  • Next.js Theming: CSS Variables for Adaptive Data Visualization
  • Creating Scrolling Text With HTML, CSS, and JavaScript

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!