# Html alignment

**URL:** <https://forum.kirupa.com/t/html-alignment/65466>\
**Category:** Uncategorized\
**Created:** [September 26, 2004, 8:02pm UTC](https://forum.kirupa.com/t/html-alignment/65466 "2004-09-26T20:02:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lookupthere](https://avatars.discourse-cdn.com/v4/letter/l/e99b99/32.png) [@lookupthere](https://forum.kirupa.com/u/lookupthere)\
**Post date:** [September 26, 2004, 8:02pm UTC](https://forum.kirupa.com/t/html-alignment/65466/1 "2004-09-26T20:02:18Z")

</div>

hi everybody!

i’m trying to center my flash movie vertically and horizontally on any screen. since i’m not very familiar with html, i’m kinda struggling… what code do i need to put in my html page?

thanks for any help!

martin

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 26, 2004, 8:19pm UTC](https://forum.kirupa.com/t/html-alignment/65466/2 "2004-09-26T20:19:22Z")

</div>

There are various ways to get your swf centered. This is what I normally do:  
One file (index.htm) contains 3 frames (horizontal ones).

code for index.htm would look like this: (between \<html\>\</html\> tags)

\<frameset rows="_,555,_" frameborder=“NO” border=“0” framespacing=“0”\>  
\<frame src=“maintop.htm” name=“topFrame” scrolling=“NO” noresize \>  
\<frame src=“mainmiddle.htm” name=“mainFrame” scrolling=“no” noresize\>  
\<frame src=“mainbottom.htm” name=“bottomFrame” scrolling=“NO” noresize\>  
\</frameset\>  
\<noframes\>\<body\>  
\</body\>\</noframes\>

where:

- = current resolution - 555 / number of \* (in this case 2)  
555 = height of your swf file

Remember: your maintop, mainmiddle and mainbottom shouldn’t have any margins if you do use margins then the “555” should be “height of your swf + 2xmargin”

Put your swf in mainmiddle and code it like this: (between \<html\>\</html\> tags)

\<body topmargin=“0” bottommargin=“0”\>  
\<table width=“100%” border=“0” cellpadding=“0” cellspacing=“0”\>  
\<!–DWLayoutTable–\>  
\<tr\>  
\<td width=“100%” height=“100%” align=“center” valign="middle\>  
HERE YOUR SWF  
\</td\>  
\</tr\>  
\</table\>  
\</body\>

That should do the trick…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 26, 2004, 8:50pm UTC](https://forum.kirupa.com/t/html-alignment/65466/3 "2004-09-26T20:50:52Z")

</div>

that’s a bloody difficult way of doing it!!

```auto

<table height=100% width=100%>
<tr><td valign="middle">
  <center>
    code for your swf
  </center>
</td></tr>
</table>

```

that ought to save you a few kb’s of webspace compared to another certain method 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 26, 2004, 8:52pm UTC](https://forum.kirupa.com/t/html-alignment/65466/4 "2004-09-26T20:52:43Z")

</div>

wait a second! it’s the same code. how come you made it so long-winded!!! i’m so confused… sorry.

[edit] Oh, I see. all of that stuff you’ve got about puting in all that nonsense with the height of the flash movie and the resoluction is **NOT** required.[/edit]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 26, 2004, 9:14pm UTC](https://forum.kirupa.com/t/html-alignment/65466/5 "2004-09-26T21:14:40Z")

</div>

thanks boys! :thumb:
