0

I have this simple html page that I edited (from html page made by pano2vr program) to show panorama on. For some reason it does not center the flash content inside div on all browsers. On Chrome it works perfectly but on Firefox and Explorer it stays on left side. I put fixed width on flash content and auto borders that centered it on Chrome. I found similar problems and some said "display: block" should help but it didn't do anything for me. I tried many other things too but they didn't actually work. Something centered it on IE but I forgot which one it was and it didn't still work on Firefox. I'd really appreciate if someone knew how to fix the code so that it would work on other browsers as well. The complete code is below and the site itself can be seen here: http://lenseproductions.com/panoramat/nauvo/output/1.html

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>Nauvon antiikkikauppa</title>
<script type="text/javascript" src="swfobject.js">
    </script>
    <style type="text/css" title="Default">
        body, div, h1, h2, h3, span, p {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #DDDDDD;
alignment-adjust: central;
            }
        body {
font-size: 10pt;
background-color: #111111;
        }
        table,tr,td {
            font-size: 10pt;
            border-color : #777777;
            background : #dddddd; 
            color: #000000; 
            border-style : solid;
            border-width : 1px;
        }
        h1 {
            font-size: 18pt;
        }
        h2 {
            font-size: 14pt;
        }
        .warning {
            font-weight: bold;
        }
    </style>    
</head>
 <body link="#00CCFF" vlink="#808080" alink="#0099FF"> 
<body align="center">
<h1 align="center">Nauvon Antiikkikauppa</h1>
<p>
    <script type="text/javascript">
    <!--

        var flashvars = {};
        var params = {};
        params.quality = "high";
        params.bgcolor = "#ffffff";
        params.allowscriptaccess = "sameDomain";
        params.allowfullscreen = "true";
        params.base="..";
        var attributes = {};
        attributes.id = "pano";
        attributes.name = "pano";
        attributes.align = "middle";
        swfobject.embedSWF(
            "../1_out.swf", "flashContent", 
            "960", "540", 
            "9.0.0", "expressInstall.swf", 
            flashvars, params, attributes);
    //-->
    </script>
<div align="center" id="flashContent" style="display:block; width: 960px; margin: 0 auto;">
  <div align="center"><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a>
    </p>
  </div>
</div>

<dir>
<p align="center">&nbsp;</p>
</dir>
<div><dir>
  <p align="center">Saat halutessasi esittelyn koko ruudulle klikkaamalla alarivin oikeanpuolisinta nappia.</strong></p>
<p align="center">Seuraavaan pisteeseen pääset painamalla nuolesta tai klikkaamalla kartan pisteitä. </p>
  <p align="center">Saat tutkittua hyllyjä   tarkemmin liikkumalla hiiren kanssa tai alla olevien nappien avulla.</p>
  <p align="center"><strong>Esittelyn tuottanut ja toteuttanut <a target="_blank" href="http://lenseproductions.com">Lense Productions</a></strong></p>
</dir></div>
<p align="center">&nbsp;</p>
 </body>

4

1 回答 1

0

不要使用align属性居中(body标签没有对齐属性)。请改用 csstext-align属性。

body { text-align:center; }

您还应该考虑验证您的 HTML,因为还存在其他问题。

于 2013-05-24T16:11:42.963 回答