Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the concept of browser private prefix

Shulou Source: shulou.com Published: 2022-06-01 04:09:29 09月22日 Update

Today, I would like to share with you the relevant knowledge of what the concept of browser private prefix is. The content is detailed and the logic is clear. I believe most people still know too much about this, so share this article for your reference. I hope you can get something after reading this article, let's learn about it.

Introduction to browser private prefix

Because many attributes of CSS3 are not yet part of the W3C standard, browsers of each kernel can only recognize CSS3 attributes with their own private prefixes. When we write CSS3 code, we need to prefix the property with the browser's private prefix, and then the browser of this kernel can recognize the corresponding CSS3 attribute.

CSS3 browser private prefix

For example, if we want to use CSS3 to achieve a fillet with a radius of 10px, we might write:

one

Border-radius:10px

But not all browsers recognize the border-radius attribute. For example, chrome browsers can only recognize-webkit-border-radius (prefixed with-webkit-), while firefox browsers can only recognize-moz-border-radius (prefixed with-moz-). Because in order for mainstream browsers to achieve rounded corners, we need to write:

one

two

three

four

five

Border-radius:10px

-webkit-border-radius:10px; / * compatible with chrome and Safari*/

-moz-border-radius:10px; / * compatible with Firefox*/

-ms-border-radius:10px; / * compatible with IE*/

10px; / * compatible with opera*/

These are all the contents of the article "what is the concept of browser Private prefix". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Tags: Browsers prefixes private attributes knowledge articles concepts content kernels fillets effects different large mainstream code examples radius most of them not yet Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker OPPO Reno NVidia MariaDB macOS