5 replies [Last post]
gautamz07
gautamz07's picture
Offline
Enthusiast
Last seen: 4 years 4 days ago
Timezone: GMT+5.5
Joined: 2014-04-24
Posts: 265
Points: 403

What does the following selection do ? is it selecting everything under .flipper class ? i literally mean everything under .flipper class ??

.flipper>*
	{
	position: absolute;
	width: 100%;
	height: 100%;
	}

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 day 2 hours ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9767
Points: 3849

It says

Any child of .flipper

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

gautamz07
gautamz07's picture
Offline
Enthusiast
Last seen: 4 years 4 days ago
Timezone: GMT+5.5
Joined: 2014-04-24
Posts: 265
Points: 403

One more question

The * selector is said to be best avoided as its very taxing on the browser , so is that kind of selection bad practice ??

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 week 3 days ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Hi gautamz07 It's very

Hi gautamz07
It's very general, targets anything and everything.
In your example it is only used in targeting the direct children of .flipper so shouldn't be an issue.

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 day 2 hours ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9767
Points: 3849

Mostly, it's stupid

Seldom is it necessary. Most properties that you'd want to give to the child elements are heritable. Those that are not should be considered item by item.

If you would give us a real world example of its use, we could be more helpful. Frankly, my limited imagination is unable to conjure up a case where I'd even consider that selector construct.

In general, the use of the * selector indicates someone who doesn't quite get it. There was a time when it was helpful because of IE's stupidity. There is no longer a sane reason to use outdated hacks for IE. Those who do, probably haven't a clue as to its original purpose, and simply paste it into the css out of ignorance.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

gautamz07
gautamz07's picture
Offline
Enthusiast
Last seen: 4 years 4 days ago
Timezone: GMT+5.5
Joined: 2014-04-24
Posts: 265
Points: 403

Thank you

Well thanks gary and tony Smile