Allowed characters for CSS identifiers

The charset doesn’t matter. The allowed characters matters more. Check the CSS specification. Here’s a cite of relevance: In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+00A0 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a … Read more

Select odd even child excluding the hidden child

:nth-child() pseudo-class looks through the children tree of the parent to match the valid child (odd, even, etc), therefore when you combine it with :not(.hidden) it won’t filter the elements properly. Alternatively, we could fake the effect by CSS gradient as follows: .hidden {display:none;} .wrap { line-height: 1.2em; background-color: orange; background-image: linear-gradient(transparent 50%, green 50%); … Read more

CSS blur on background image but not on content [duplicate]

jsfiddle .blur-bgimage { overflow: hidden; margin: 0; text-align: left; } .blur-bgimage:before { content: “”; position: absolute; width : 100%; height: 100%; background: inherit; z-index: -1; filter : blur(10px); -moz-filter : blur(10px); -webkit-filter: blur(10px); -o-filter : blur(10px); transition : all 2s linear; -moz-transition : all 2s linear; -webkit-transition: all 2s linear; -o-transition : all 2s linear; … Read more

Defining Variable Variables using LESS CSS

Use interpolation and escaping, parentheses in the selector and parametric mixins to get the desired effect: Dynamic variables by interpolation: In a string, “@{variable}” is replaced with the value of the variable. They can also be nested: Given @{@{var}-foo} and @var: bar;, the result is “barfoo”. The resulting value is quoted. To remove these quotes, … Read more