Elements inherit certain default values from browsers. You need to "reset" all of them in order to make the input element appear as the surrounding text:
p input {
border: none;
display: inline;
font-family: inherit;
font-size: inherit;
padding: none;
width: auto;
}
This is as close as you can get with CSS alone. If you want a variable width, you will have to resort to JS instead of CSS, as adjusting an element to it's value is way beyond the scope of CSS. Modifying elements after the fact, based on user input or changes due to just-in-time effects, is what JS/jQuery are used for.
Note that depending on the browser you're using (and due to the possibility that future browsers might do things radically different that nowadays' practices), this list is not necessarily exhaustive.
The only way you can "fake" this effect in a clean manner without JS is to use an element with a contenteditable
attribute, which (unlike an input element) will store user input in the content of the element instead of its value. For an example of this technique, see this answer
Though while you won't need JS to get the effect, you would need it to retrieve the content of the element. The only use past that I can imagine is if you're providing a printable document that never needs to programmatically handle the input or store it.