A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: screen size

  1. #1
    Senior Member
    Join Date
    May 2002
    Posts
    122

    screen size

    wat's the html code when ppl view my webby but regardless if their monitor is 800 by 600 or 1024 by 800 .. it would still be centralised ???

  2. #2
    Retired SCORM Guru PAlexC's Avatar
    Join Date
    Nov 2000
    Location
    NJ
    Posts
    1,387
    If I read you right, you want to keep everything centered in the browser window?

    Simply add a table cell onto your page, set the alignments to center, and put all your content inside.

    Code:
    <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td align="center" valign="middle">
    
    PUT CONTENT HERE
    
    
    </td>
    </tr>
    </table>
    "What really bugs me is that my mom had the audacity to call Flash Kit a bunch of 'inept jack-asses'." - sk8Krog
    ...and now I have tape all over my face.

  3. #3
    "the bringer of light"
    Join Date
    Jul 2002
    Posts
    39
    Are you talking about embedding an swf. file into HTML?

    If so, open a new HTML page, insert a table at 100% by 100%. Then in that table, insert a new table to the size of your swf. file. Make the orginal centre the new table by choosing to align it in the middle and centre. Code should look something like this:

    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
    <table width="100%" height="100%" border="1" cellpadding="0" cellspacing="0">
    <tr>
    <td align="center" valign="middle"><table width="400" height="400" border="1" cellpadding="0" cellspacing="0">
    <tr>
    <td>&nbsp;</td>
    </tr>
    </table></td>
    </tr>
    </table>
    </body>
    </html>

    This works for an swf. file sized 400px X 400px. Just change the size of your table to suit your swf. and you should be done.

    Hope that helps...
    One mans junk is another mans treasure...

  4. #4
    Senior Member
    Join Date
    May 2002
    Posts
    122
    so if the user have a different screen resolution den will it affect the text or pics ??

  5. #5
    Senior Member
    Join Date
    May 2002
    Posts
    122
    Originally posted by shield
    Are you talking about embedding an swf. file into HTML?

    If so, open a new HTML page, insert a table at 100% by 100%. Then in that table, insert a new table to the size of your swf. file. Make the orginal centre the new table by choosing to align it in the middle and centre. Code should look something like this:

    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
    <table width="100%" height="100%" border="1" cellpadding="0" cellspacing="0">
    <tr>
    <td align="center" valign="middle"><table width="400" height="400" border="1" cellpadding="0" cellspacing="0">
    <tr>
    <td>&nbsp;</td>
    </tr>
    </table></td>
    </tr>
    </table>
    </body>
    </html>

    This works for an swf. file sized 400px X 400px. Just change the size of your table to suit your swf. and you should be done.

    Hope that helps...


    wat if i not inserting any flash ?? will this also work ??

  6. #6
    "the bringer of light"
    Join Date
    Jul 2002
    Posts
    39
    This should work no matter what. It is simply using your table correctly.

    If you are loading a JPEG, GIF or whatever - just make sure the main table centers everything inside itself.
    One mans junk is another mans treasure...

  7. #7
    No I can't do it by tommorow.. 1stbite's Avatar
    Join Date
    Feb 2003
    Location
    UK
    Posts
    1,300
    Code:
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
    <table width="100%" height="100%" border="1" cellpadding="0" cellspacing="0">
    <tr>
    <td align="center" valign="middle"><table width="400" height="400" border="1" cellpadding="0" cellspacing="0">
    <tr>
    <td>
    
    
    
    //dump allyour web content here
    
    
    </td>
    </tr>
    </table></td>
    </tr>
    </table>
    </body>
    </html>

    if you use that code and put all your code for your content where stated above, you web content will be in a 400 x400 size no matter what size web bowser they use...

    example:

    1024x768 browers will see your content at 400x400 with space around the out side.

    800x600 browsers will also see your content at 400x400 with slightly less space around the outside.
    and in a blink of an eye...
    Media and Multimedia Courses in Nottingham - First Diploma | IMedia | HND | Foundation Degrees | BA(Hons) Top Ups.

    Give a Twit a chance!

  8. #8
    "the bringer of light"
    Join Date
    Jul 2002
    Posts
    39
    What he said...

    Good luck!
    One mans junk is another mans treasure...

  9. #9
    No I can't do it by tommorow.. 1stbite's Avatar
    Join Date
    Feb 2003
    Location
    UK
    Posts
    1,300
    LMAO, and what he said also...
    and in a blink of an eye...
    Media and Multimedia Courses in Nottingham - First Diploma | IMedia | HND | Foundation Degrees | BA(Hons) Top Ups.

    Give a Twit a chance!

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center