Results 1 to 3 of 3

Thread: something easy, surely

  1. #1
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default something easy, surely

    hi everyone its probably really simple but im really rubbish using code im using dreamweaver and it never works how i want it to. basically i have my .swf file on a html black page and i want it centered in the middle of the broswer (complete centre) with a black background. and i also want it to stay centered no matter what screen rez or whether the window is resized.

    valign=centre and align=centre

    doesnt seem to work, any ideas?? thnx for any help - heres the full code of the page;

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Index</title>
    <style type="text/css">
    <!--
    body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    }
    -->
    </style></head>
    <body bgcolor="#000000">
    <script language="JavaScript">
    function Launch(page, width, height) {
    OpenWin = this.open(page, "kirupa", "toolbar=no, menubar=no ,location=no, scrollbars=yes, resizable=yes, width=" + width + ", height=" + height + ", top=" + (screen.height/2 - height/2) + ", left=" + (screen.width/2 - width/2) + "\"");
    }
    </script>
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!-- saved from url=(0013)about:internet -->
    <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
    <!--DWLayoutTable-->
    <tr>
    <td width="132" height="122">&nbsp;</td>
    <td width="78">&nbsp;</td>
    <td width="772">&nbsp;</td>
    <td width="141">&nbsp;</td>
    </tr>
    <tr>
    <td height="515">&nbsp;</td>
    <td colspan="2" align="center" valign="middle"><object classid="clsid:27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="850" height="515">
    <param name="movie" value="1.swf">
    <param name="quality" value="high">
    <embed src="1.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="850" height="515"></embed>
    </object></td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td height="73">&nbsp;</td>
    <td valign="top"><embed src="music.mp3" width="0" height="0"></embed></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td height="57">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    </table>
    </body>
    </html>

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Code:
    ...
    body {
     background-color: #000000;
    }
    #_center_content_ {
       margin: 0 auto;
       text-align:center;
       width: 100&#37;;
       min-width: 800px; 
    }
    ...
    HTML Code:
    ...
    <body>
      <div id="_center_content_">
          __VIDEO_FILE___
      </div>
    </body>
    ...

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Nope. Won't centre it vertically.

    iheartyou, beware DreamWeaver: it produces very bad code (like this hideous thing). Try:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html/strict.dtd">
    <html>
      <head>
        <title>Index</title>
        <style type="text/css">
          body {
            background-color: black;
            color: white;
          }
    
          .movie-container {
            position: absolute;
            top: 50&#37;;
            left: 50%;
          }
    
          .movie {
            width: 850px;
            margin-left: -425px;
            height: 515px;
            margin-top: -257px;
          }
        </style>
      </head>
      <body>
        <div class="movie-container">
          <object
            type="application/x-shockwave-flash"
            data="c.swf?path=movie.swf" 
            width="850"
            height="515"
          >
            <param name="movie" value="1.swf">
            <param name="quality" value="high">
          </object>
        </div>
      </body>
    </html>
    A quick (but not completely exhaustive) check for the quality of code is to run it through the validator. You should be using the HTML 4.01 Strict DOCTYPE.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •