JSFiddle - React, Tailwind, and code Playground

HTML

This line uses the <code>&lt;code&gt;</code> element.
<div style="width:300px; border: 1px solid blue; margin: 2em;">
    
    And here's some random HTML code:
    <pre>
-- if class slot unavailable, check super class
  -- if applied to argument, pass it to the class method new        
  setmetatable(class, {
    __index = function(self,key) return self.super[key] end,
    __call  = function(self,...) return self.new(self,unpack(arg)) end 
  })

  -- if instance method unavailable, check method slot in super class    
  setmetatable(class.methods, {
    __index = function(self,key) return class.super.methods[key] end
  })
  return class</pre>
</div>
Notice that it wraps, while still preserving the original whitespace as much as possible.

CSS

pre {
    white-space: pre-wrap;
    background: #a8e
}

code {
    background: #ae8;
}