.container {
  width: 70%;
  height: 70%;
  margin: 40px auto;
  /*background: red;*/
}
.centered {
  position: relative;
  display: inline-block;
 
  width: 50%;
  padding: 1em;
  background: orange;
  color: white;
}
div.container4 {
    height: 10em;
    position: relative }
div.container4 p {
    margin: 0;
    background: yellow;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-right: -50%;
    transform: translate(-50%, -50%) }

.center {
  width: 600px;
  margin: 0 auto;
}