JSFiddle - React, Tailwind, and code Playground

by Glenn Micallef

HTML

<div class="container">
    <span class="text" contenteditable="true">Lorem ipsum dolor </span>
    <span class="tag">Tag</span>
    <span class="text" contenteditable="true"> sed dignissim maximus mattis </span>
    <span class="tag">Tag</span>
    <span class="text" contenteditable="true"> vel ex ut nisi elementum tincidunt libero</span>
</div>

CSS

.container {
	height: 200px; 
	width:200px; 
	background:lightpink; 
	margin:50px auto;
	font-family: sans-serif;
	padding: 10px;
}
.text {
	display: inline; 
	white-space: pre-line; 
	word-wrap: break-word;
	padding: 0px; 
	/*overflow:hidden;*/
}

.tag {
	display: inline; 
	/*overflow:hidden;*/
	margin: 1px 0px; 
	background: yellow;
}