So I have seen this CSS rule-set in a library:
[text-uppercase] {
text-transform: uppercase;
}
and I am not sure on how to use it in a div
<div class="text-uppercase | [text-uppercase]"></div>
I have tried both, but neither are working. I am seeing this in ionic2.
The square brackets are used as an attribute selector, to select all elements that have a certain attribute value. In other words, they detect attribute presence.
A CSS selector is the first part of a CSS Rule. It is a pattern of elements and other terms that tell the browser which HTML elements should be selected to have the CSS property values inside the rule applied to them.
Square brackets are attribute selector syntax. Show activity on this post. The selector you've given in the question means it would need all three words: The element name 'input', the attribute 'type' and the value for that attribute being 'radio'.
] - right square bracket (U+005D) - HTML Symbols.
For the selector to work:<div text-uppercase></div>
[text-uppercase]
selector matches an attribute on a tag.
It's not a class, you encountered a so called attribute selector.
It matches every html element that has got that attribute set, whatever the value. I.e. <section text-uppercase="true">
, <div text-uppercase="something">
, <nav text-uppercase>
…
Look at the reference provided on the link above for more advanced usage scenarios.
[text-uppercase] {
text-transform: uppercase;
}
<span text-uppercase>hello</span>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With