I have a code editor online and would like to have the HTML which is typed be executed as a mini web page in a frame in the corner.
It currently looks like a word processor on the left of the screen with a white square (background is black) on the right. I want what the user enters into the editor to be displayed in the white box as if a whole page were being loaded there.
Currently, this is done in javascript by setting the innerHTML of the frame to be the code as the user types, but if the user uses fixed positioning on an element, that element can be moved outside the frame. How can I make everything stay within the frame as if it were the whole web page scaled down into a smaller size?