SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: centering?

  1. #1
    SitePoint Evangelist jor133d's Avatar
    Join Date
    Jul 2003
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    centering?

    How do I have my flash doument align in the middle of a html doument. In the center of the page? Is there some code?

  2. #2
    SitePoint Evangelist ktown's Avatar
    Join Date
    May 2001
    Location
    toronto
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i don't think you can...

    well you can trick it for horizontal alignement - just put the code inside a table and set the table to align="center"

    well.. i guess you could also make 3 rows - set table hight to 100% then put your content into the middle cell and set that to valign="middle"

    though i don't think that will work - not the vertical alignment anyways... but you can set the window to open to the exact size of the move using JS... on the button that calls the swf file.

    hopefully this helped.

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2002
    Location
    New York, NY
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the best way to do this would be via css and negative margin values:

    put this code in the <head> tag:
    Code:
    <style type="text/css"><!--
    .movie {
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -XXXpx;
    margin-top: -YYYpx;
    }
    --></style>
    NOTE: replace XXX with HALF the WIDTH of your flash movie and replace YYY with HALF the HEIGHT of your flash movie

    then, simply place class="movie" in your <embed> tag i.e.:
    Code:
    <embed src="flashMovie.swf" class="movie" height="XXX" etc.>
    hope it helps!

    zing
    Better-Barter.com
    Logo store full of unique, professional identities
    perfect for you or your client!

  4. #4
    SitePoint Guru MG315's Avatar
    Join Date
    Mar 2003
    Location
    Houston, Texas
    Posts
    758
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    heh good idea, didnt think of that CSS trick


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
  •