-2

I have few text inputs and I want to make them readonly by CSS but not with :

readonly: "readonly" inlined

I checked this topic:

How to style readonly attribute with CSS?

but it doesn't work for me.

I tried like this:

input.my-class[readonly]
{
}

and all of the variations of readonly="readonly" etc. but it doesn't work at all.

Community
  • 1
  • 1
mathinvalidnik
  • 1,486
  • 10
  • 33
  • 56

1 Answers1

4

CSS cannot set any html attributes.

CSS can only style them.

Danield
  • 114,415
  • 36
  • 213
  • 236