<div class="container">
<p>Coco</p>
</div>
xxxxxxxxxx
html,
body {
width: 100%;
height: 100%;
display: flex;
}
.container {
width: 150px;
height: 150px;
padding: 10px;
margin: auto;
contain: paint;
border: 1px solid red;
}
p{
position: relative;
border: 1px solid #333;
margin: 5px;
font-size: 14px;
left: -100px;
}
xxxxxxxxxx
$('.container').on('click', e => {
$('.container').eq(0).append('<p>Coco</p>')
})
This Pen doesn't use any external CSS resources.