CSS selector for element being edited (not hover!), only WebKit -


i have elements editable (content-editable, is). each 1 inside regular spans. there way add border span text cursor (insertion point) is? know "mouse" cursor can use ::hover.

<span class=one>alpha</span> <span class=one>beta</span> <span class=one>gamma</span> 

for example, if "|" text insertion point, word "one" becomes red border

al|pha beta gamma 

no javascript, css.

thank you!

use selector :focus

note: span must content-editable

css

.one:focus{     border: solid 1px red;     display: inline-block; } 

demo here


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -