Search code examples
javascripthtmlcssiframeframes

HTML CSS - How to fit the iframe content to the iframe


I have an issue when I change the size of the frame frame gets bigger but not the content. I need to fit the content inside the Iframe to the frame.

My css is:

#IDNAME { 
  -moz-transform: scale(0.90, 0.90); 
  -moz-transform-origin: 
  top left; 
}

enter image description here


Solution

  • You need to explicitly define the width and height of the iframe in order for it to scale the content. Also see this.

    #IDNAME { 
      -moz-transform: scale(0.90, 0.90); 
      -moz-transform-origin: 
      top left; 
      width: 1024px;
      height: 576px;
    }