/    Sign up×
Community /Pin to ProfileBookmark

font gets smaller in iFrame

Hello,

I’m trying to display a page using iFrame, but it seems that the font of the page in the iframe is smaller that when I open the same page directly.

Am I doing something wrong? How can I fix this issue?
Because I really don’t want to modify the size per browser through javascript.

This only happens in Firefox (v3). In Opera, IE and Safari there is no problem work great.

Main page:
HTML Code:

[code=html]
<html>
<body>
<iframe src=”frame_page.html” frameborder=”1″ height=”250″ width=”100%”></iframe>
</body>
</html>[/code]

The frame page:
HTML Code:

[code=html]
<html>
<body>
<pre><font style=”font-family: courier new; font-size:10pt;”><div>Some text here</div></font></pre>
</body>
</html>[/code]

Thank you.

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@FangAug 19.2008 — Try a valid document:&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;title&gt;frame_page.html&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;pre style="font-family: courier new; font-size:.8em;"&gt;Some text here&lt;/pre&gt;
&lt;/body&gt;
&lt;/html&gt;

pt units are for printing, use relative units. http://www.w3.org/QA/Tips/font-size
Copy linkTweet thisAlerts:
@the_dpauthorAug 19.2008 — I'm not sure it's a good idea to use relative units. I'm relying on the fixed pixel size of the letters (that's why I use a mono font). You see I'm working on an editor, and the only reasonable way to make the text cursor is with a layer.
Copy linkTweet thisAlerts:
@the_dpauthorAug 20.2008 — Try a valid document:&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;title&gt;frame_page.html&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;pre style="font-family: courier new; font-size:.8em;"&gt;Some text here&lt;/pre&gt;
&lt;/body&gt;
&lt;/html&gt;

pt units are for printing, use relative units. http://www.w3.org/QA/Tips/font-size[/QUOTE]


The valid document statement did no solve the issue, and with it I now unable to use styles [b]top[/b] and [b]left[/b].

Where can I read about creating a valid document?
Copy linkTweet thisAlerts:
@FangAug 20.2008 — top and left only work on positioned elements (relative or absolute).

http://www.w3.org/TR/REC-html40/

http://validator.w3.org/
×

Success!

Help @the_dp spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...