So I am trying to vertical align and horizontal a textbox span inside a parent div, the problem is it can valign or halign fine, not both. If it is a one line text it works fine, but if it is a long paragraph that takes multiple lines of the parent div, it does not vertical align.

```
.objprevicnt {
position: absolute;
margin: 0;
top: 50%;
left: 50%;
width:inherit;
height:50px;
transform: translate(-50%, -50%);
}

```

also I am changing the text dynamically

```
document.getElementById("myid").innerHTML = 'some text';

```

so it should recenter as appropriate.

You would think this would be a simple thing, vertical and horizontal centering of a box inside another box, should work regardless of the size of text inside the box.