<div>
  <span class="smth"></span>
  <span class="smth"></span>
  <span class="smth"></span>
  <span class="smth"></span>
  <span class="smth"></span>
</div>
body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.content {
font-family: sans-serif;
  font-size: 2rem;
  text-shadow: 0 0 3px #000;
  color: #555;
}
View Compiled
const p = document.createElement("p");
const text = document.createTextNode("hi there");
const el = document.querySelectorAll(".smth");

p.appendChild(text);
p.classList.add("content");

el.forEach(item => {
  item.appendChild(p.cloneNode(true));
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.