-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,566
  • 10
  • 35
  • 57

1 Answers1

4

CSS cannot set any html attributes.

CSS can only style them.

Danield
  • 121,619
  • 37
  • 226
  • 255