How do I center a swf in html?

  • paulo
  • Born
  • Born
  • No Avatar
  • Joined: Aug 13, 2004
  • Posts: 2
  • Status: Offline

Post August 13th, 2004, 12:10 pm

Hi,
this is driving me insane.. how do I centre an swf in an html file ABSOLUTELY i.e. centred vertically & horizontally but display the file at 100%, not stretch it to fill the browser window ?

Any ideas would be greatly appreciated

thanks
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post August 13th, 2004, 12:10 pm

  • Vladdrac
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Feb 04, 2004
  • Posts: 2136
  • Loc: Louisville, Ky
  • Status: Offline

Post August 13th, 2004, 12:18 pm

I think you can just put your object tags in a div and use css for your positioning.
  • paulo
  • Born
  • Born
  • No Avatar
  • Joined: Aug 13, 2004
  • Posts: 2
  • Status: Offline

Post August 13th, 2004, 12:25 pm

whoooa !!!!!!!!

a) How quick was that reply ! &
b) I expected a reply like " click absolute centre" in properties in Dreamweaver, I'm fairly new at this

thanks
  • Mas Sehguh
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Aug 07, 2004
  • Posts: 1853
  • Status: Offline

Post August 13th, 2004, 12:52 pm

The following "HTML" will do it. There actually is no height attribute for the table element, but commonly used browsers will pay attention to it, and if they ignore it, it's not a problem, the file will just be centered at the top.

Code: [ Select ]
<html><head><title>example</title></head>

<body
><table height="100%" width="100%">
<tr><td valign="middle" align="center">

<!-- normal object code in here - make sure to set a width and height -->

</td></tr>
</table>
</body></html>
  1. <html><head><title>example</title></head>
  2. <body
  3. ><table height="100%" width="100%">
  4. <tr><td valign="middle" align="center">
  5. <!-- normal object code in here - make sure to set a width and height -->
  6. </td></tr>
  7. </table>
  8. </body></html>


Dreamweaver is not useful if you don't know what you are doing. You would benefit yourself by reading information on how to mark up HTML by hand. Otherwise, you'll always be helpless when browsers don't understand your code, and you'll end up guessing when you could be knowing. Dreamweaver is a tool, but it can't make well-made Web pages for you -- that's your responsibility.

If you're new to this, you may wish to read something like Learning HTML 3.2 by Examples ( http://www.cs.tut.fi/~jkorpela/HTML3.2/ ), or, if you're very new, http://www.cs.tut.fi/~jkorpela/html-primer.html

The document about HTML 3.2 may seem out of date because the current version of HTML is 4.01 (and then there's XHTML 1.0 and 1.1, which are no more useful than HTML 4.01), but I still think it is an excellent place to learn the basics, and its author has much more useful information on his Web site as well. Later on, you will probably wish to learn things like CSS, and perhaps some of the aspects of HTML 4.01 that 3.2 lacks.
  • eslie
  • Novice
  • Novice
  • No Avatar
  • Joined: Sep 23, 2004
  • Posts: 21
  • Status: Offline

Post September 23rd, 2004, 10:28 pm

use dreamweaver.. its really easy to enter swf in a web page when using dreamweaver... dreamweaver n flash both being macromedia products
  • NoamDesign
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Sep 23, 2004
  • Posts: 35
  • Loc: Israel
  • Status: Offline

Post September 24th, 2004, 6:08 am

y not just:

<center><EMBED bla bla bla></center>
  • neksus
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Sep 10, 2004
  • Posts: 2194
  • Loc: Canada
  • Status: Offline

Post September 24th, 2004, 6:57 am

center will just put it in the center horizontally. he wants it vertically too.
as for the swf, put its actual height/width properties in the embed.
  • NoamDesign
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Sep 23, 2004
  • Posts: 35
  • Loc: Israel
  • Status: Offline

Post September 24th, 2004, 7:00 am

oh oops... missed the vert thingy... DIV will do as said ^^^

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 134 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.