pheromix pheromix - 10 months ago 73
CSS Question

What does an asterisk before an equal sign mean (*=) ? What about the exclamation mark?

I found these notations in a css :

.nav li ul li a [class*="icol-"] { opacity: 0.5; filter: alpha(opacity=50); padding-top: 4px; }

.secNav .chzn-container { width: 100%!important; max-width: 100%; }

What does the meaning of the
before the
sign ? Is it a comment when using the
symbol ?

Answer Source

! is part of !important; it is not a comment. The !important forces a rule to always be applied. It's typically used to override or to prevent your style from being overridden.

The *= means "contains". So in the example, the first line is looking for all children of .nav li ul li a elements with classnames that contain "icol-".