-WebKit margin before and extended browser prefix and kernel

-WebKit margin before is the definition method statement of article segment P container in css3.0.

Display: block only defines the P container as a block

And: – WebKit margin before/after: 1em — defines the upper margin and the lower margin of P respectively, which are 1 times the height of the font. If it is a 10px word, then the margin is 10px

-WebKit margin start/end: 0px — define the P container as 0px for both left and right margins.

In other words, in CSS3:

p {

display: block;

-webkit-margin-before:1em;

-webkit-margin-end:1em;

-webkit-margin-after:1em;

-webkit-margin-start:1em;

}

Equivalent to CSS2:

p {

display: block;

margin-top: 1em;

margin-right: 1em;

margin-bottom: 1em;

margin-left: 1em;

}

But because CSS3 requires a higher browser version, there is no popular CSS3 style in China, and CSS2 is still the mainstream, but it should be the world of CSS3 in the future, because it represents advanced technology.

browser kernel:

WebKit was originally an open source project of Apple company, and their own Safari was useful. Later, Google also built an open source browser project chromium with this typesetting engine and its own V8 JavaScript engine, and only made its own Chrome with this project. At the same time, the two browser cores on the mobile platform use WebKit. Thanks to chromium engine, there are also many WebKit browsers on PC platform: 360, window of the world, maple browser, sunflower browser, Sogou browser, roam 3 and Cheetah browser. Basically speaking, I’m a dual core, and I use chromium for any speed mode. Correspondingly, Microsoft’s IE uses the Trident typesetting engine, which is commonly known as the IE kernel. Firefox also has its own gecko typesetting engine. Apple’s iBooks also uses WebKit as the typesetting engine, while Sigil, the editing software, uses chromium, because it is also the WebKit kernel.

browser prefix:

Common: – WebKit – (chrome), –

     -moz-(Firefox)、

     -0-(Opera)、

     -ms-(IE)

Why a private prefix

W3C, the organization that formulates HTML and CSS standards, is very slow. Usually, members of W3C organizations put forward a new attribute, such as rounded border radius, which everyone thinks is good. However, W3C will not formulate standards for this attribute. Instead, it has to go through complex procedures and go through a lot of reviews. Browser vendors are not willing to wait so long. They think that an attribute is enough When you are familiar with it, you will add support to the browser. However, to avoid the W3C publishing the standard in the future, let the new version of the browser support the border radius attribute after the standard writing of border radius is established.

For example, chrome 10 doesn’t recognize the border radius writing method. It can only use – WebKit border radius, but chrome 12 can recognize it. Therefore, when writing CSS, it can ensure that the web pages of chrome 10 and 12 can be displayed normally.

Similar Posts: