.heart {
  background: #e74c3c;
}
//Crear corazon
let heart = document.createElement("DIV");
heart.className = "heart";
document.body.appendChild(heart);
//Asignar tamaño       
let tam = 100;
heart.style.width = tam+"px"
heart.style.height = tam+"px"

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.