• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

iframe wird nicht mit Firefox Zentriert dargestellt! Warum??

Status
Für weitere Antworten geschlossen.
Hallo,

Ja aber wie muss ich den Code anpassen das in meinem Fall der iframe zentriert ist??

Mein Code:
Code:
</td> 
                    </tr> 
                         <td> 
  <tr> 
<th valign="top"><iframe src="http://www.ambuehren.de/nletter/newsletter.php" style="border:0px #FFFFFF none;" name="myiframe" scrolling="auto" frameborder="0" align="center" marginheight="0px" marginwidth="0px" height="156" width="104"></iframe></th> 
  </tr> </td> 
                    </tr>  
			  </table>
	  </td>
	</tr>


Der HTML Code der Demo von Prophet's Empfehlung:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
  <title>Dead Centre</title>
 </head>
<style type="text/css" media="screen">
body 
	{
	color: white;
	background-color: #003;
	margin: 0px
	}

#horizon        
	{
	color: white;
	background-color: transparent;
	text-align: center;
	position: absolute;
	top: 50%;
	left: 0px;
	width: 100%;
	height: 1px;
	overflow: visible;
	visibility: visible;
	display: block
	}

#content    
	{
	font-family: Verdana, Geneva, Arial, sans-serif;
	background-color: transparent;
	margin-left: -150px;
	position: absolute;
	top: -35px;
	left: 50%;
	width: 300px;
	height: 70px;
	visibility: visible
	}

.bodytext 
	{
	font-size: 14px
	}

.headline 
	{
	font-weight: bold;
	font-size: 24px
	}
</style>
 <body>
  <div id="horizon">
   <div id="content">
	<div class="bodytext">
	 

Dieser Text ist

	  <span class="headline">ABSOLUT ZENTRIERT</span>

	  und bleibt auch mittig!
	 </p>
    </div>
   </div>
  </div>		
 </body>
</html>
 
ach bei dir ist das ja in einer tabelle...

um das iframe in einer tab-zelle zu zentrieren musst du mit css:
Code:
td
{
text-align:center;
vertical-align:middle;
}

wenn die horizontale aurichtung nicht funzt dann machfolgendes:
Code:
iframe
{
position:absolute; /*könnte auch sein das da relative hin muss musst du testen*/
left:50%;
margin-left:-300px; /*die hälfte der breite deines iframes....*/
}
 
Ähh... :? Ich schnall das nicht!! Kannst du mir das mal schritt für schritt erkären wie ich nun vorgehen muss?
 
ich kann mit
body {
text-align:center;
}
in firefox auch keine tabelle mittig anzeigen....
natürlich geht auch vertical-align:mittle und das gleiche im table{} nicht... :(

mfg, fätzminator
 
Status
Für weitere Antworten geschlossen.
Zurück
Oben