We can set style using attribute or its value.
Set Style using attribute : –
Syntax: –
Selector [attribute] { CSS ;}
Ex: –
div [id] { color: red; }
Set style using attribute and its value: –
Syntax: –
Selector [attribute = “value”] { CSS }
Ex: –
div[id=“data”] { color: red; }
Set Style using an attribute value containing a specified word.
Syntax: –
[attribute ~= “value”] { CSS }
Ex:-
[class ~= “game”] { color: red; }
game
supergame
game-super
gamesuper
super-game
game super
super game
Set Style using with the specified attribute starting with the specified value.
Syntax: –
[attribute |= “value”] { CSS }
Ex:-
[class |= “game”] {color: red;}
The value must be a whole word.
Ex: –
“game” or “game-super”
game
supergame
game-super
gamesuper
super-game
game super
super game
Set Style whose attribute value begins with a specified value.
Syntax: –
[attribute ^= “value”] { CSS }
Ex:-
[class ^= “game”] {color: red;}
game
supergame
game-super
gamesuper
super-game
game super
super game
It is not necessary that the value should be a whole word.
Set Style whose attribute value ends with a specified value.
Syntax: –
[attribute $= “value”] { CSS }
Ex:-
[class $= “game”] {color: red;}
game
supergame
game-super
gamesuper
super-game
game super
super game
It is not necessary that the value should be a whole word.
Latest posts by rajeshkumar (see all)
- How to get Blackduck Trial version? - December 3, 2023
- PHP ionCube Error: cannot be decoded by this version of the ionCube Loader - December 2, 2023
- Cloudbees CD/RO Error: ectool - November 24, 2023