<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <div id="main"></div>
</body>
</html>
#main {
  width: 500px;
  height: 500px;
}
var $message = document.getElementById('message'); 
var zr = zrender.init(document.getElementById('main'));

var rect = new zrender.Rect({
  shape: {
    x: 50,
    y: 10,
    width: 300,
    height: 125
  },
  style: {
    fill: '#efefef',
    text: '第一行\n第二行\n第三行',
    textLineHeight: 24
  }
})
zr.add(rect)

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/zrender/4.0.7/zrender.min.js