I am trying to assign a style to an element where its attribute index=0
The selector :first-letter
is not working.
How can do it the selector by attribute (in this case [index='0']
)?
My desired output for the first element is: Text 0 Paragraph (red text)
p[index='0']{
color:red;
}
p[index='0']{
text-transform: lowercase;
}
p[index='0']:first-letter {
text-transform: uppercase;
}
<p index="0">TEXT 0 PARAGRAPH</p>
<p index="1">TEXT 1 PARAGRAPH</p>
<p index="2">TEXT 2 PARAGRAPH</p>
<p index="3">TEXT 3 PARAGRAPH</p>