Solved

Iframe space is annoying :)

Posted on 2009-05-19
14
347 Views
Last Modified: 2012-05-07
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
0
Comment
Question by:Pigdogmonster
  • 6
  • 6
  • 2
14 Comments
 
LVL 42

Expert Comment

by:David S.
ID: 24420019
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
 

Author Comment

by:Pigdogmonster
ID: 24420046
Hi,

that didnt work I am afraid :(
0
 
LVL 42

Expert Comment

by:David S.
ID: 24420064
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
 

Author Comment

by:Pigdogmonster
ID: 24420169
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
 
LVL 4

Expert Comment

by:Answering4uAnt
ID: 24420359
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
 
LVL 4

Expert Comment

by:Answering4uAnt
ID: 24420412
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
 

Author Comment

by:Pigdogmonster
ID: 24420549
can you see the file now?

Iframe.JPG
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 4

Accepted Solution

by:
Answering4uAnt earned 125 total points
ID: 24420568
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
 

Author Comment

by:Pigdogmonster
ID: 24420601
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
 
LVL 4

Expert Comment

by:Answering4uAnt
ID: 24420607
Without seeing the entire code that was causing the issue I couldn't honestly say.
0
 

Author Comment

by:Pigdogmonster
ID: 24420619
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
 
LVL 4

Expert Comment

by:Answering4uAnt
ID: 24420642
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
 

Author Comment

by:Pigdogmonster
ID: 24420699
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
 
LVL 4

Expert Comment

by:Answering4uAnt
ID: 24420753
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

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now