Iframe space is annoying :)

Hi and thanks for looking at my question.

I have created an Iframe and added it to my page, it looks ok but there is a gap at the top of the content of the Iframe and I would like to know how to remove this please :)

I have uploaded an image so you can see exaclty what I mean.

Thanks

PDM
PigdogmonsterAsked:
Who is Participating?
 
Answering4uAntConnect With a Mentor Commented:
That looks like an issue with the content page, not the iframe itself.
I have used the exact code you provided for your iframe but linked to another page here and there is no white space at all so it indicates it not an iframe issue
0
 
David S.Commented:
Try adding this to the top of the document that you have loaded into the iframe:
<style type="text/css">
html, body {
  margin: 0;
  padding: 0;
}
</style>

Open in new window

0
 
PigdogmonsterAuthor Commented:
Hi,

that didnt work I am afraid :(
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
David S.Commented:
Well it was a guess based on so little information.  You wouldn't happen to have an example page we could see, would you?
0
 
PigdogmonsterAuthor Commented:
Here's the page that contains my Iframe..

<iframe allowtransparency="true" name="BottomFrame" id="BottomFrame" scrolling="yes" marginheight="0" frameborder="0" align="middle" height="220px" width="100%" src="/Apps/Retail_Helpdesk/pages/spare_parts/IframeForm.asp?SPOrdRef=<%=varSPOrdRef%>&MatSAPCode=<%=varMatSAPCode%>&BTN=<%=varBTN%>"></iframe>


My Iframe page contians this... (as well as other info)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >



<body leftmargin="0" topmargin="0">

data here

</body>

</html>
0
 
Answering4uAntCommented:
Have you got the full url for the src within the Iframe? It may be that you have set the height of the Iframe to be 220px but the content isn't 220px high.
0
 
Answering4uAntCommented:
Scrap my last response about the height of the content, didn't read the question properly (gap at top not bottom).
Still would be beneficial to see the full src to see it not working properly (Plus the image you mentioned isn't uploaded)
0
 
PigdogmonsterAuthor Commented:
can you see the file now?

Iframe.JPG
0
 
PigdogmonsterAuthor Commented:
your absolutley right.  I took all the content out of the bottom page and there was no space there.

Any idea's why there would be space at the top?
0
 
Answering4uAntCommented:
Without seeing the entire code that was causing the issue I couldn't honestly say.
0
 
PigdogmonsterAuthor Commented:
no worries, I'll paste the entire code.

it contains some ASP too.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" 
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" >
 
<head>
 
 
 
 
</head>
 
 
 
 
<!--#include virtual="Apps/inc/system/getUserDetails.asp"-->
<!--#include file="../../inc/Translation.asp"-->
<%
varSPOrdRef = request.form("SPOrdRef")
if varSPOrdRef="" then
varSPOrdRef = request.QueryString("SPOrdRef")
end if
 
varMatSAPCode = request.form("MatSAPCode")
if varMatSAPCode="" then
varMatSAPCode = request.QueryString("MatSAPCode")
end if
 
varBTN = request.form("BTN")
if varBTN="" then
varBTN = request.QueryString("BTN")
end if
 
if varSPOrdRef ="" or isnull(varSPOrdRef) then
varWhatType ="New"
else
varWhatType ="Old"
end if
%>
 
<body STYLE="margin: 0px; padding: 0px;">
 
<table border="1" align='center' style="border-collapse: collapse" bordercolor="white" width="84%" STYLE="margin: 0px; padding: 0px;">
      <TR bgcolor="#4682B4">
      <td width="1%" align="center"><b><font face="Tahoma" size="1"><%varTagname=257
              TranslateFront()
             Response.write(varTranslatedVarible)%></font></b></td>
      <td width="33%" align="center"><b><font face="Tahoma" size="1"><%varTagname=258
              TranslateFront()
             Response.write(varTranslatedVarible)%></font></b></td>
      <td width="1%" align="center"><b><font face="Tahoma" size="1"><%varTagname=259
              TranslateFront()
             Response.write(varTranslatedVarible)%></font></b></td>
      
      <td width="1%" align="center"><b><font face="Tahoma" size="1"><%varTagname=260
              TranslateFront()
             Response.write(varTranslatedVarible)%></font></b></td>
      
      <td width="9%" align="center"><b><font face="Tahoma" size="1"><%varTagname=261
              TranslateFront()
             Response.write(varTranslatedVarible)%></font></b></td>
      <td width="16%" align="center"><b><font face="Tahoma" size="1"><%varTagname=262
              TranslateFront()
             Response.write(varTranslatedVarible)%></font></b></td>
      <td width="6%" align="center"><b><font face="Tahoma" size="1"><%varTagname=263
              TranslateFront()
             Response.write(varTranslatedVarible)%></font></b></td>
      <td width="6%" align="center"><b><font face="Tahoma" size="1"><%varTagname=264
              TranslateFront()
             Response.write(varTranslatedVarible)%></font></b></td>
      
      <td align="center"><b><font face="Tahoma" size="1"><%varTagname=265
              TranslateFront()
             Response.write(varTranslatedVarible)%></font></b></td>
      
      <%if NOT varBTN ="Review" then%>
      <td align="center"><b><font face="Tahoma" size="1"><%varTagname=266
              TranslateFront()
             Response.write(varTranslatedVarible)%></font></b></td>
      <td></td>
      <%end if%>
      
    </tr>
    
        
  <%if varWhatType ="Old" then 
  'this means you are looking at an order that has a record
  'display the list of components from the line table
  
        'response.write(round(varPrice,2)) - Round to 2 decimal places
 
		'Retreive the 1st 2 records of what components have been added
		set oRSeofd2=Server.CreateObject("ADODB.recordset")
		sqltext2="Select * from HDSPORDLIN Where SPOrdRef = '"&varSPOrdRef&"' order by SPITEMREF DESC"
		oRSeofd2.open sqltext2, "dsn=HDSS;uid=web_Admin;pwd=F1nnforest"
 
		if NOT oRSeofd2.EOF then
			
		iRecordCount = 0
			
		do while NOT oRSeofd2.EOF
 
		varSPItmRef = oRSeofd2("SPItemRef")
		varCompSAPCode = oRSeofd2("CompSAPCode")
		varSelectedQuantity = oRSeofd2("Quantity")
		varChargableOrFOC = oRSeofd2("FOC_Flag")
		varPrice = oRSeofd2("Price")
		varReason = oRSeofd2("Reason")
		varCustCode = oRSeofd2("CustCode")
		varUOM = oRSeofd2("UOM")
		
				if varCustCode="" or isnull(varCustCode) then
					varRedFont=("<font color='red'><b>")
				end if
		
		
		if NOT varReason="" then
		
			'Translate the reason code if it has a value
			set oRSeofd4s67=Server.CreateObject("ADODB.recordset")
			sqltext4s67="Select description from HDSPLUREASON Where SPType = '"&varReason&"' AND Lang_Code='"&varLang_Code&"' Order by SPType ASC"
			oRSeofd4s67.open sqltext4s67, "dsn=HDSS;uid=web_Admin;pwd=F1nnforest"
 
					if NOT oRSeofd4s67.EOF then
						varReasonDescrip = oRSeofd4s67("description")
					end if
		end if
		
		
			if NOT varPrice ="" then
			varPrice = formatnumber(oRSeofd2("Price"),2)
			end if
			'varPrice = formatnumber(varPrice, 2)
 
					
					'if NOT varPrice ="" then
						'varDiscount = formatnumber(oRSeofd2("Discount"),2)
					'end if
 
			if NOT varPrice="" OR NOT isnull(varPrice) then 
			varDisabled="DISABLED"
			varSubmit = "Amend"
			end if
 
		'now for each Component Sap code get the detailed information
		set oRSeofd4s=Server.CreateObject("ADODB.recordset")
		sqltext4s="Select price from HDCOMPONENTPRICE Where CompSAPCode = '"&varCompSAPCode&"'"
		oRSeofd4s.open sqltext4s, "dsn=HDSS;uid=web_Admin;pwd=F1nnforest"
 
			if NOT oRSeofd4s.EOF then
				varSAPPrice = formatnumber(oRSeofd4s("price"),2)
			end if
 
		'Get the description of the component
		set oRSeofd246=Server.CreateObject("ADODB.recordset")
		sqltext246="Select Description,ServiceInd from HDCOMPONENTS WHERE CompSAPCode ='"&varCompSAPCode&"'"
		oRSeofd246.open sqltext246, "dsn=HDSS;uid=web_Admin;pwd=F1nnforest"
    
		if NOT oRSeofd246.EOF then
			varCompSAPCodeFullDescrip = oRSeofd246("Description")
			varServiceInd = oRSeofd246("ServiceInd")	
		end if	
			
		'now for each Component Sap code get the detailed information
		set oRSeofd4=Server.CreateObject("ADODB.recordset")
		sqltext4="Select Catalog_Ref,Quantity from HDPRODUCTCOMPONENT Where MatSAPCode = '"&varMatSAPCode&"' AND CompSAPCode = '"&varCompSAPCode&"'"
		oRSeofd4.open sqltext4, "dsn=HDSS;uid=web_Admin;pwd=F1nnforest"
 
			if NOT oRSeofd4.EOF then
				varCatalog_Ref = oRSeofd4("Catalog_Ref")
				varQuantity = oRSeofd4("Quantity")
			end if
			
				IF iRecordCount Mod 2 = 0 THEN%>
						<TR bgcolor="#e6e6e6">
				<% ELSE %>
						<TR bgcolor="#f3f3f3">
				<% End if %>
 
	  <form method='post' action='SPFullupdate.asp' target='BottomFrame' STYLE="margin: 0px; padding: 0px;">
	
      <td width="7%" align='center'><font face='tahoma' size='2'><%=varRedFont%>&nbsp;<%=varCatalog_Ref%></td>
      <td width="33%" align='center'>&nbsp;<font face='tahoma' size='1'><%=varCompSAPCode%> - <%=varCompSAPCodeFullDescrip%></td>
      <td width="9%" align='center'>&nbsp;<font face='tahoma' size='2'><%=varQuantity%></td>
      
      <td width="7%" align='center'><font face='tahoma' size='2'>&nbsp;
      
      
      <select name="reason" <%if varBTN="Review" then%>DISABLED<%end if%> STYLE='font-size:8pt'>
     
    <%if NOT varReason="" OR NOT isnull(varReason) then%>
    <option value ="<%=varReason%>"><%=varReasonDescrip%></option>
    <%else%>
    <option value =""><%varTagname=134
              TranslateFront()
             Response.write(varTranslatedVarible)%></option>
    <%end if%>
	<%        
    dim oRSceNT23
	set oRSceNT23=server.createobject("ADODB.recordset")
	sqltextNT23="Select * from HDSPLUREASON Where Lang_Code='"&varLang_Code&"' AND Delete_Flag='n' ORDER BY description ASC"
	oRSceNT23.open sqltextNT23, "dsn=HDSS;uid=web_Admin;pwd=F1nnforest"
    
	do while NOT oRSceNT23.EOF
	varSPType = oRSceNT23("SPType")
	varDescription = oRSceNT23("Description")
	%>
    <option value ="<%=varSPType%>"><%=varDescription%>
    <% 
	oRSceNT23.movenext
	loop 
	
	varRedFont=""
	
    oRSceNT23.Close
    Set oRSceNT23 = Nothing
    %>
    </option>              
    </select>
            
      </td>
           
      <td width="9%" align='center'>&nbsp;<font face='tahoma' size='2'><%if NOT varBTN="Review" then%><input type='text' STYLE="font-size:8pt"<%if NOT varQuantity="" OR NOT isnull(varQuantity) then%>value="<%=varSelectedQuantity%>"<%else%>value='0'<%end if%> name='Quantity' size='5'><%else%><%=varSelectedQuantity%><%end if%></td>
      
      <td width="8%" align='center'>&nbsp;<font face='tahoma' size='2'>
      
      
      	<%if NOT varBTN="Review" then%><input type='checkbox'<%if varServiceInd="N" OR isnull(varServiceInd) then%><%if varChargableOrFOC="y" then%>CHECKED value="<%=varChargableOrFOC%>"<%end if%><%elseif varServiceInd="Y" then%>DISABLED<%end if%> STYLE="font-size:8pt" name='ChargableOrFOC' size='5'><%else%><input DISABLED type='checkbox'<%if varChargableOrFOC="y" then%>CHECKED<%end if%> STYLE="font-size:8pt" value="ON"><%end if%>
      
      </td>
      
      <td width="6%" align='center'>&nbsp;<font face='tahoma' size='2'><%=varSAPPrice%><input type='hidden' value="<%=varSAPPrice%>" name='SAPPrice'></td>
       
      <td width='3%' align='center'>&nbsp;<font face='tahoma' size='2'><%=varUOM%></td>
      
         
      <td width='3%' align='center'>&nbsp;<font face='tahoma' size='2'><%if NOT varBTN="Review" then%><%if varPrice="" or isnull(varPrice) then%> <%else%><input type='text' value="<%=varPrice%>" STYLE="font-size:8pt" name='Price' size='4'><%end if%><%else%><%=varPrice%><%end if%></td>
      
      <%if NOT varBTN ="Review" then%>
      
      <td align='center'>&nbsp;
      <input type="image" src="/Apps/Retail_Helpdesk/Images/delete.gif" name="BTN1" onClick="hidAction.value='Delete'" />
      <input type="hidden" name="hidAction" />
      </td>
      
      <td>
      <input type='hidden' value='<%=varFFOrdRef%>' name='REF'>
	  <input type='hidden' value='<%=varFFItmRef%>' name='ITMREF'>
	  
	  <input type='hidden' value='<%=varSPOrdRef%>' name='SpOrdRef'>
	  <input type='hidden' value='<%=varSPItmRef%>' name='SPItmRef'>
	  
      <input type='hidden' value='<%=varMatSAPCode%>' name='MatSAPCode'>
      <input type='hidden' value='<%=varCompSAPCode%>' name='CompSAPCode'>
      <input type='hidden' value='<%=varMatSAPCodeDescrip%>' name='MatSAPCodeDescrip'>
      <input type='hidden' value='<%=varWithoutRef%>' name='WithoutRef'>
      
      <input type='hidden' value='<%=varQuery%>' name='query'>
      <input type='hidden' value='<%=vartrans_query%>' name='trans_query'>
      
      <input type="image" src="/Apps/Retail_Helpdesk/Images/greentick.gif" name="BTN2" onClick="hidAction.value='Create'" />
   
     <!-- <input type='image' src='/Apps/Retail_Helpdesk/Images/greentick.gif' alt='Update' name='Imgbutton' value='Add'>
      -->
      
      </td>
         
      <%end if%>
      
      </tr>
    </form>
       
    <%
    iRecordCount = iRecordCount + 1
 
    oRSeofd2.Movenext
    loop
   
    set oRSeofd23=Server.CreateObject("ADODB.recordset")
    'sqltext23="SELECT SUM(Price) AS 'CombinedPrices', SUM(Quantity) AS 'CombinedQty', SUM(Quantity_Charge) AS 'CombinedCharge', SUM(Discount) AS 'CombinedDiscount' FROM HDSPORDLIN Where SPOrdRef ='"&varSPOrdRef&"'"
	sqltext23="SELECT SUM(Price) AS 'CombinedPrices', SUM(Quantity) AS 'CombinedQty' FROM HDSPORDLIN Where SPOrdRef ='"&varSPOrdRef&"'"
	oRSeofd23.open sqltext23, "dsn=HDSS;uid=web_Admin;pwd=F1nnforest"
 
	'if NOT varFullPrice="" then
	varFullPrice =oRSeofd23("CombinedPrices")
	'end if
	
	
	'>>>>>>>>>>>>>>>>>>>>>>>> SB - 26/11/08
	'Retrieve the sales org VAT from table
	
	Dim oRSeofd99
	set oRSeofd99=Server.CreateObject("ADODB.recordset")
    sqltext99="SELECT VAT_Rate,Currency FROM HDLUVAT Where Sales_Org ='"&varSales_Org&"'"
	oRSeofd99.open sqltext99, "dsn=HDSS;uid=web_Admin;pwd=F1nnforest"
	
	if NOT oRSeofd99.EOF then
	
	varVAT_Rate=FormatNumber(oRSeofd99("VAT_Rate"),2)
	varCurrency=oRSeofd99("Currency")
	
	end if
	
	oRSeofd99.close
	set oRSeofd99=nothing
	
	'>>>>>>>>>>>>>>>>>>>>>>>>>>Amendment End	
	
	
	
	
	if varBTN ="Review" then 
	varVat = FormatNumber(((varFullPrice /100)* varVAT_Rate),2)
    varGross = (((varFullPrice /100)* varVAT_Rate) + varFullPrice)
    varGross = FormatNumber(varGross, 2)	
	end if
    	
	if NOT varFullPrice="" then
    varFullPrice =FormatNumber(oRSeofd23("CombinedPrices"),2)
    end if
    
    varFullFOC =oRSeofd23("CombinedQty")
        
    	 else
  			varBasketisEmpty="yes"%>
		  </table>
  			<br>
    		<center>
    		<font face='tahoma' size='2'>
			
			
			<%varTagname=255
              TranslateFront()
             Response.write(varTranslatedVarible)%>
    		</center>
    
   		 <%end if%>		
   <%else%>
</table>
   			<br>
    		<center>
    		<font face='tahoma' size='2'><%varTagname=255
              TranslateFront()
             Response.write(varTranslatedVarible)%>
    		</center> 
   		 		
  <%end if%>
  
  <br><br>
 
<%if varWhatType ="Old" then%>
  
  <tr>
  <P>
  <tr>
<TR bgcolor="#f3f3f3">
	
	  
      <td width="7%" align='center'></td>
      <td width="14%" align='center'><font face='tahoma' size='2'><b>
	  <%if NOT varBasketisEmpty="yes" then%><%varTagname=272
              TranslateFront()
             Response.write(varTranslatedVarible)%>:<%end if%></td>
      <td width="9%" align='center'></td>
      
      <td width="7%" align='center'></td>
      
      <td width="19%" align='center'>&nbsp;<font face='tahoma' size='2'><b><%=varFullFOC%></td>
      <td width="6%" align='center'></td>
      <td width="32%" align='center'></td>
      <td width="32%" align='center'></td>
      <td align='right'>&nbsp;<font face='tahoma' size='2'><b> <%=varCurrency%><%=varFullPrice%></td>
      <%if NOT varBTN ="Review" then%>
      <td></td>
      <td></td>
      <%end if%>
      
</tr>
      
     <%if varBTN ="Review" then%> 
    
    
  <tr bgcolor="#f3f3f3">
    <td colspan="7"  style="border-style: none;">&nbsp;</td>
    <td width="13%" align='right' style="border-style: none;"><font face='tahoma' size='2'><b><%varTagname=270
              TranslateFront()
             Response.write(varTranslatedVarible)%></td>
    <td align='right' style="border-style: none;"><font face='tahoma' size='2'><b><%=varCurrency%><%=varVat%></td>
  </tr>
 
  <tr bgcolor="#f3f3f3">
    <td colspan="7"  style="border-style: none;">&nbsp;</td>
      
    <td width="13%" align='right' style="border-style: none;"><font face='tahoma' size='2'><b><%varTagname=271
              TranslateFront()
             Response.write(varTranslatedVarible)%></td>
    <td  align='right' style="border-style: none;"><font face='tahoma' size='2'><b><%=varCurrency%><%=varGross%></td>
  </tr>
  
  <%end if%>
  
  </table>
  </center>
 
<br>
<center>
 
<%
 
 
 
	if NOT varBTN="Review" then
 
		'check to see if all the entries are completed
		set oRSeofd55=Server.CreateObject("ADODB.recordset")
		sqltext55="Select completed from HDSPORDLIN Where SPOrdRef = '"&varSPOrdRef&"' AND completed='no'"
		oRSeofd55.open sqltext55, "dsn=HDSS;uid=web_Admin;pwd=F1nnforest"
 
			if oRSeofd55.EOF then
				varComplete ="yes"
			else
				varComplete ="no"
			end if
	
	
	end if	
 
%>
 
 
<%end if%>
 
</center>
</body>
 
</html>

Open in new window

0
 
Answering4uAntCommented:
If its any of the asp that caused the original issue I am unlikely to find it, I am a total beginner with ASP and just learning it but will try have a look when I get a few mins spare.
Which bits did you take out that fixed the iframe problem?
0
 
PigdogmonsterAuthor Commented:
thank you.

I'm not sure if it is the ASP, I think its more likley to be the HTML.
I removed everything in the body and replaced it with Hello World and there was no space at all.

Thanks again

PDM
0
 
Answering4uAntCommented:
Right, had a very quick look and using my very little experience with asp your page is using 2 .inc files.
I am assuming the cog background is part of one of the inc files? The white space seems to stop where the cog stops so I would suggest reducing the height of the cog image to therefore reduce the amount of white background space this leaves.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.