How to style readonly attribute with CSS?

Spread the love

Sometimes, we want to style readonly attribute with CSS.

In this article, we’ll look at how to style readonly attribute with CSS.

How to style readonly attribute with CSS?

To style readonly attribute with CSS, we use attribute selectors.

For instance, we write

input[readonly] {
  background-color: blue;
}

to select inputs with the readonly attribute with input[readonly].

Conclusion

To style readonly attribute with CSS, we use attribute selectors.

Leave a Reply

Your email address will not be published.