function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
developerTeamdeveloperTeam 

How to change Font-size of an Iframe

How to change the Font-size in <apex:iframe>   ??

Best Answer chosen by Admin (Salesforce Developers) 
developerTeamdeveloperTeam

Hi,

 

I had Cracked the Issue....
As we couldn't Change the font-size of the content of Iframe ...Instead we can Zoom the Content...
So I had Used  the Folowing Code:

 

<style>
#frameScale { width: 100%; height: 100%; padding: 0; position:relative; left:-90px; top:0px; overflow: hidden; font-size: 800px;}
#frame { width: 100%; height: 100%; position:relative; left:0px; top:0px; }
#frame { -ms-zoom: 1.2; -moz-transform: scale(1.2); -moz-transform-origin: 0px 0; -o-transform: scale(1.2); -o-transform-origin: 0 0; -webkit-transform: scale(1.2); -webkit-transform-origin: 0 0; }
</style>

<div id="frameScale ">
<apex:iframe src="URL" frameborder="false" scrolling="true" title="Iframe" id="frame"/> 
</div>

Thank You..

 

Please accept my answer as a solution if my solution was helpful. This will make it available to others as a proper answer. If you felt that I went above and beyond please give me Kudos by clicking on on the star icon.

 

Sandeep | Salesforce Developer

All Answers

JK84JK84

Hi,

 

Try this .....

 

<div class="Style class name">

    <apex:iframe src=" " title=" " >

</div>

 

Style class name is the name of the CSS class with custom styling like font size, etc.

developerTeamdeveloperTeam
Hello,

I had already tried with this .... like
<head>
<style>
.outputpanel{ //Style Class Name
font-size: 23px;
font-family:Arial,Helvetica,sans-serif;
font-style:normal;
background-image:none;
height: 600px;
width: 1000px;
}
</style>
</head>
<body>
<div class="outputpanel">
<apex:iframe src="{!b}" frameborder="false" scrolling="true" title="New Color Edit" />
</div>
</body>
In above change is effected only in Height and Width ...n the rest remains the same ... how to solve this issue ????
Please check this as we had tried for isdtp=vw in URL.... the Font-size has reduced to smaller size..... Help me in solving this issue
JK84JK84

I guess, you need to add jQuery to apply CSS to the content of iFRAME.

 

May be the following can help you :

 

http://stackoverflow.com/questions/15812946/how-to-applying-css-style-into-an-iframe-content

 

developerTeamdeveloperTeam
I had already checked the same page ... and applied ... but its not working in my page...
Please check the code ... I had posted in my previous code... and provide Solution..
my iframe is
< apex:iframe src="https://cs5.salesforce.com/'+ p.getKeyPrefix() +'/e'+'?isdtp=vw" frameborder="false" />
developerTeamdeveloperTeam

Hi,

 

I had Cracked the Issue....
As we couldn't Change the font-size of the content of Iframe ...Instead we can Zoom the Content...
So I had Used  the Folowing Code:

 

<style>
#frameScale { width: 100%; height: 100%; padding: 0; position:relative; left:-90px; top:0px; overflow: hidden; font-size: 800px;}
#frame { width: 100%; height: 100%; position:relative; left:0px; top:0px; }
#frame { -ms-zoom: 1.2; -moz-transform: scale(1.2); -moz-transform-origin: 0px 0; -o-transform: scale(1.2); -o-transform-origin: 0 0; -webkit-transform: scale(1.2); -webkit-transform-origin: 0 0; }
</style>

<div id="frameScale ">
<apex:iframe src="URL" frameborder="false" scrolling="true" title="Iframe" id="frame"/> 
</div>

Thank You..

 

Please accept my answer as a solution if my solution was helpful. This will make it available to others as a proper answer. If you felt that I went above and beyond please give me Kudos by clicking on on the star icon.

 

Sandeep | Salesforce Developer

This was selected as the best answer