I have restric the view port area in editor without iframe

  Kiến thức lập trình

I’m creating an editor where I render HTML in a div. I want to restrict this viewport similar to how the Chrome Developer Tools allows you to set any width and height to simulate a device view. How can I achieve this?