JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!



Iframe problem


G

keyboard_arrow_up
0
keyboard_arrow_down


First Post Mark as Spam gawrrell
Posts: 1 - Registered: 2011-09-22 10:11:07

Hello , i have a small problem with iframe content width.
I have 2 pages with the folowing code :

PAGE 1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head><title>Page1</title></head>
<body leftmargin="0" topmargin="0" bgcolor="black">
<iframe src="page2.html" width="100%"></iframe>
</body>
</html>



PAGE 2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Page 2</title>
</head>
<body leftmargin="0" topmargin="0">
<table style="color:white" width="100%" cellspacing="0" cellpadding="0" border="1">
<tr><td width="100%">SIZE IS 100%</td></tr>
</table>
</body>
</html>



The problem is that the iframe content width is smaller than 100% of the page
I've attached a photo to see the problem

Smaller square ( page 2 table border) have the width set to 100% and is smaller than the iframe border


I've tested with multiple doctypes but the problem remains

I forgot to say that i have IE 9 but the problem is the same on Mozila




R

keyboard_arrow_up
0
keyboard_arrow_down


Reply #1 Mark as Spam Rasmus Lindström
Posts: 32 - Registered: 2015-12-20 08:38:02

It might be a default setting, test adding this to your CSS

html, body {
margin: 0;
padding: 0;
}






JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!




MENU
Advertising