Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css selector for html5 tag "Contenteditable" [duplicate]

Tags:

html

css

How can I use css selector for contenteditable="true"

<div id="1" name="1" contentEditable="true"></div>
like image 934
alonblack Avatar asked Jul 13 '26 02:07

alonblack


1 Answers

Use a CSS attribute selector:

div[contenteditable="true"] {
    background: red;
}

In English, this means: "Find all divs which have an attribute of contenteditable with its value set to true." In the above example, we find all div elements that are contenteditables and give them a red background.

like image 108
James Lawson Avatar answered Jul 14 '26 16:07

James Lawson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!