How do I center a swf in html?

  • paulo
  • Born
  • Born
  • paulo
  • Posts: 2

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Vladdrac
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2136
  • Loc: Louisville, Ky

Post 3+ Months Ago

I think you can just put your object tags in a div and use css for your positioning.
  • paulo
  • Born
  • Born
  • paulo
  • Posts: 2

Post 3+ Months Ago

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
  • Posts: 1853

Post 3+ Months Ago

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
  • eslie
  • Posts: 21

Post 3+ Months Ago

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
  • NoamDesign
  • Posts: 35
  • Loc: Israel

Post 3+ Months Ago

y not just:

<center><EMBED bla bla bla></center>
  • neksus
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2194
  • Loc: Canada

Post 3+ Months Ago

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
  • NoamDesign
  • Posts: 35
  • Loc: Israel

Post 3+ Months Ago

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 97 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.