search
HomeWeb Front-endCSS TutorialWhat is the purpose of CSS property prefixes?

Function: Let browsers support a new CSS property in advance before it becomes a standard. W3C is very slow to formulate standards; and browser vendors are short on marketing time. If an attribute is mature enough, support will be added to the browser; in order to avoid future changes when W3C publishes standards, a private prefix is ​​added. to support new properties in advance.

What is the purpose of CSS property prefixes?

Students who have used CSS3 properties know that CSS3 properties need to be prefixed by each browser. Even now, there are still many properties that need to be prefixed. .

Browser manufacturers have been implementing CSS3 before, but it has not yet become a true standard. For this reason, some CSS3 style syntaxes provide browser-specific prefixes while they still exist. The main popular browser kernels now include:

  • Trident kernel: the main representative is IE browser

  • Gecko kernel: the main representative is Firefox

  • Presto kernel: the main representative is Opera

  • Webkit kernel: the main representatives are Chrome and Safari

For browsers with different cores, CSS3 attributes (some attributes that need to be prefixed) need to be added with different prefixes, which are also called private prefixes of the browser. The CSS3 attributes after adding the private prefix can be said It is a private property corresponding to the browser:

  • Trident kernel: the prefix is ​​-ms

  • Gecko kernel: the prefix is ​​-moz

  • Presto kernel: The prefix is ​​-o

  • Webkit kernel: The prefix is ​​-webkit

CSS The role of attribute prefix

Browser private prefix is ​​the browser’s early support for new CSS attributes.

In order to be compatible with the writing method of the old version. For example: Newer versions of browsers support writing directly: border-radius.

-moz represents the private properties of the Firefox browser, -ms represents the private properties of the IE browser, and -webkit represents the private properties of Safari and Chrome.

Because the W3C, the organization that formulates HTML and CSS standards, is very slow.

Usually, when a member of the w3c organization proposes a new attribute, such as rounded border-radius, everyone thinks it is good, but when w3c develops standards, it requires very complicated procedures, reviews, etc. Browser vendors have tight marketing time. If an attribute is mature enough, support will be added to the browser.

To avoid future changes when w3c publishes standards, add a private prefix, such as -webkit-border-radius, to support new attributes in advance.

Wait until w3c announces the standard in the future and the standard writing method of border-radius is established, then the new version of the browser will support the border-radius writing method.

For more programming-related knowledge, please visit: Programming Courses! !

The above is the detailed content of What is the purpose of CSS property prefixes?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Iterating a React Design with Styled ComponentsIterating a React Design with Styled ComponentsApr 21, 2025 am 11:29 AM

In a perfect world, our projects would have unlimited resources and time. Our teams would begin coding with well thought out and highly refined UX designs.

Oh, the Many Ways to Make Triangular Breadcrumb Ribbons!Oh, the Many Ways to Make Triangular Breadcrumb Ribbons!Apr 21, 2025 am 11:26 AM

Oh, the Many Ways to Make Triangular Breadcrumb Ribbons

SVG Properties in CSS GuideSVG Properties in CSS GuideApr 21, 2025 am 11:21 AM

SVG has its own set of elements, attributes and properties to the extent that inline SVG code can get long and complex. By leveraging CSS and some of the forthcoming features of the SVG 2 specification, we can reduce that code for cleaner markup.

A Few Functional Uses for Intersection Observer to Know When an Element is in ViewA Few Functional Uses for Intersection Observer to Know When an Element is in ViewApr 21, 2025 am 11:19 AM

You might not know this, but JavaScript has stealthily accumulated quite a number of observers in recent times, and Intersection Observer is a part of that

Revisting prefers-reduced-motionRevisting prefers-reduced-motionApr 21, 2025 am 11:18 AM

We may not need to throw out all CSS animations. Remember, it’s prefers-reduced-motion, not prefers-no-motion.

How to Get a Progressive Web App into the Google Play StoreHow to Get a Progressive Web App into the Google Play StoreApr 21, 2025 am 11:10 AM

PWA (Progressive Web Apps) have been with us for some time now. Yet, each time I try explaining it to clients, the same question pops up: "Will my users be

The Simplest Ways to Handle HTML IncludesThe Simplest Ways to Handle HTML IncludesApr 21, 2025 am 11:09 AM

It's extremely surprising to me that HTML has never had any way to include other HTML files within it. Nor does there seem to be anything on the horizon that

Change Color of SVG on HoverChange Color of SVG on HoverApr 21, 2025 am 11:04 AM

There are a lot of different ways to use SVG. Depending on which way, the tactic for recoloring that SVG in different states or conditions — :hover,

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.