I am having trouble with a ContentEditable div that requires the hiding of characters, specifically the first and last character. I need to overlay a layer on top of the "#" character to make it appear as if the character and the border line beneath it are not present.
For example:
<div contentEditable="true"># HI CONTENT! #</div>
is the actual HTML code, but the browser should only display HI CONTENT!
. The "#" character should seamlessly blend into the background on both sides. I have tried using box-sizing: border-box
, but this seems to increase the size of the div on each side.
The desired outcome is to have the "#" characters inside a red background (in this case, but it should match the parent background which is white).
div {
display: inline-block;
border-bottom-style: groove;
box-sizing: border-box;
border-right: 20px solid #f00;
border-left: 20px solid #f00;
}
<div contentEditable="true"># HI CONTENT! #</div>
I would greatly appreciate any assistance. Thank you.