Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the CSS trick *+html do?

In a project I work with I have spotted a lot of rules like this:

* + html {
    /.../
}

I know what * and + do, but I don't get what is the point of having this construction?

I have also spotted this one:

* html {
    /.../
}

I couldn't find any place where these are applied.

AFAIK html is unique per page, so why not simply use the html selector? Is this some kind of magic?

like image 238
kuba Avatar asked Jun 27 '13 08:06

kuba


People also ask

What is the use of * in CSS?

The asterisk (*) is known as the CSS universal selectors. It can be used to select any and all types of elements in an HTML page. The asterisk can also be followed by a selector while using to select a child object. This selector is useful when we want to select all the elements on the page.

What does * mean in CSS code?

CSS selectorsAn asterisk can also be followed by a selector. This is useful when you want to set a style for of all the elements of an HTML page or for all of the elements within an element of an HTML page. syntax: * { CSS-Property: value; ........................ } Simple Example of CSS universal selectors.

What is the difference between * and HTML in CSS?

CSS is Cascading Style Sheet language. HTML is used to structure the content on the web page. CSS is used to add style to the content of a web page. HTML provides display information of various tags to the browser.


1 Answers

These are CSS hacks for Internet Explorer.

More information here: http://dimox.net/personal-css-hacks-for-ie6-ie7-ie8/

like image 55
keaukraine Avatar answered Oct 08 '22 11:10

keaukraine