I want to have a content-editable <span> whose width grow as we type and whose text is centered.
I would like a solution that does not imply Javascript if possible.
As you can see, the text-align property doesn't do anything:
#item {
  border: solid;
  text-align: center;
}<span id="item" contenteditable="true">Hello</span>
How should I do?
 
     
     
     
    