Are keyboard shortcuts automatic for contenteditable elements?

Question:
So I made a small HTML test website with a contenteditable <html> tag and I noticed that pressing CtrlB, CtrlI, etc. automatically works. Is this a feature of my device, my browser, or HTML itself?
Repl link:
N/A

<html contenteditable></html>
1 Like

Hey @element1010 !
It’s ‘content’ and ‘editable’ put together, so I’m assuming that it causes the keys to edit the page?
Yup! Just confirmed it:

2 Likes

That didn’t really answer the question; we know what contenteditable is.

But why does Ctrl + I, Ctrl + B, etc. do text styling? I didn’t even know that was a thing. And I’m also wondering:

1 Like

What device and browser are you using?

Edit:

On Firefox, Ctrl + B opens the bookmarks sidebar, Ctrl + I opens page info, and Ctrl + U opens the HTML source code.

However, all of those work on Chrome and Edge.

So @element1010, I think it depends on the browser you use. :woman_shrugging:

3 Likes

That also opens view source here in Edge, but not when you’re focused on a contenteditable element for some reason.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.