Difference between CSS3 and CSS4

Asked

Viewed 5,666 times

0

CSS 4 exists? What’s different from CSS 3? Do browsers already support? I was looking for CSS 3 on Google and saw some people mention CSS 4.

1 answer

1


SOURCE

Because it is css4, but in fact the correct is not CSS4, but Level 4 selectors, because css 3 as html 3 were divided into modules, and so having new changes and clear as always each novelty always comes to favor the programmers. Come on let’s understand a little bit about css4 and its major changes from the previous.

$div . class One of the new and more powerful changes there was in css, was the possibility to change the style of a tag taking as reference your children, see below and understand better

$div a.home {...} here we are selecting all div’s that have inside an element with the home class, and not the a.home

We can also mix with various other elements and calls, without the need to fill your id’s or class code.

$div > span {...} Here we’ll be styling all Ivs that have a child span directly;

$div > span:only-Child {...} Here all that have only one span element inside.

:not() The :not() is already present in css 3 but it is important to show its functionality that can now receive more than one selector.

*:not(H1, Strong) {...} Here we select the style for all elements except H1, and Strong.

input:not(:checked) {...} We give style to all input except checked

:Matches() This undoubtedly will greatly facilitate our work, it does nothing else and selects style for all selectors within one, so no longer need to make a lot of lines of code.

div:Matches(span, small) {...} Look at that incredible, it selects all span, and small that are inside the div, not genius ? and still can better look only.

:Matches(Section, div.imagem) img {...} Here we select all img that are within the Sectioning and Div with Image Class

input:Matches(:Focus, :Hover) {...} Here we select the inputs, with their :Focus states which is when we are inside the input and :Hover which is when we pass the mouse over it.

More in:

CSS selectors Level 4

Use CSS 4 facilities today

Selectors Level 4

The novelty of this CSS4

  • 1

    html 3 ? htmml 5 ?

  • @zentrunix what’s the matter? https://www.w3.org/MarkUp/html3/Contents.html

  • 1

    found strange this "html 3"...

  • the article is not my own, I only put in the answer because it may not be published anymore and the source does not work anymore.

  • @zentrux before HTML5 has had other older versions (HTML4, HTML3...)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.