Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 157731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:33:22+00:00 2026-05-11T10:33:22+00:00

I have constructed a frameset which is meant to center a webpage in the

  • 0

I have constructed a frameset which is meant to center a webpage in the middle of the browser window.

<html>      <frameset rows='100%,567px,100%' border='0'>         <frame src='blank.html' noresize='noresize' scrolling='yes'>          <frameset cols='100%,1128px,100%' border='0'>             <frame src='blank.html' noresize='noresize'>             <frame src='webpage.html' noresize='noresize'>             <frame src='blank.html' noresize='noresize'>         </frameset>          <frame src='blank.html' noresize='noresize' scrolling='yes'>          <noframes>             <body>Page requires a frame-supporting browser.</body>         </noframes>      </frameset>  </html> 

Blank is an empty html document. This works brilliantly in both Firefox and IE6, but in IE8 it simply shows a white page, namely the blank.html. Why is it not showing the same as in Firefox?

EDIT: This could evidently not be solved without my code, so here it is, with doctype and html tags and a few other bits excluded. I’ve tried your solution, but it still doesn’t center vertically.

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /> <meta http-equiv='imagetoolbar' content='no'> <title>Untitled Document</title> <style type='text/css'> <!-- body {     margin-left: 0px;     margin-top: 0px;     margin-right: 0px;     margin-bottom: 0px;     background-image: url(xxxbackground.gif); } #divInteraction {     position:absolute;     width:640px;     height:480px;     z-index:1;     left: 460px;     top: 47px;     overflow: hidden; } #divVideo {     position:absolute;     width:424px;     height:284px;     z-index:2;     left: 13px;     top: 101px;     overflow: visible; } #imgInteraction { } #iframeInteraction { display: none; } --> </style> </head>  <body>  <div id='divInteraction'>     <iframe id='iframeInteraction' width='100%' height='100%' ></iframe>     <img id='imgInteraction' src='powerpoint_pic_0.jpg' /> </div>    <div id='divVideo'>       <object id='wmvVideo' width='424' height='284' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112' standby='' type='application/x-ms-wmp' VIEWASTEXT>          <param name='AutoSize' value='false' />         <param name='ShowStatusBar' value='0' />         <param name='DefaultFrame' value='x' />         <param name='ShowControls' value='1' />         <param name='ShowAudioControls' value='1' />         <param name='ShowPositionControls' value='0' />         <param name='ShowTracker' value='1' />         <param name='ShowDisplay' value='0' />         <param name='ShowCaptioning' value='0' />         <param name='ShowGoToBar' value='0' />         <param name='ControlType' value='2' />         <param name='Autostart' value='1' />         <param name='InvokeUrls' value='1' />         <param name='AnimationAtStart' value='0' />         <param name='TransparentAtStart' value='0' />         <param name='SendStateChangeEv' value='1' />         <param name='SendOpenChangeEv' value='1' />         <param name='SendPlayChangeEv' value='1' />         <param name='AllowChangeCtrlType' value='1' />         <param name='AllowChangeDisplaySize' value='1' />         <param name='AllowScan' value='1' />         <param name='AutoRewind' value='1' />         <param name='PlayCount' value='1' />         <param name='Volume' value='0' />            <param name='Filename' value='http://www.example.com/example/example.wmv'/>       <embed type='application/x-mplayer2'     pluginspage='http://www.microsoft.com/windows/windowsmedia/download/'     name='Player1NS'     AutoSize='false'     ShowStatusBar='0'     DefaultFrame='x'     ShowControls='1'     ShowTracker='1'     ShowDisplay='0'     ShowCaptioning='0'     ShowGoToBar='0'     Autostart='1'     AnimationAtStart='0'     TransparentAtStart='0'     PlayCount='1'     Volume='0'     Filename='http://www.example.com/example/example.wmv'     ShowAudioControls='1'     ShowPositionControls='0'          width='424'     height='284'>     <br />    </embed>      </object>   </div>  </body> </html> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:33:23+00:00Added an answer on May 11, 2026 at 10:33 am

    No need for a frameset. The code below will center a div in the page.

    The horizontal centering is done by setting the left and right margins to auto. The vertical centering is done by placing the top of the div 50% down the page, then use a negative top margin that is half the height of the div to move it up to the center.

    You also need to specify the height of the html and body elements to 100%, otherwise they will only be as high as the content.

    The div has position:relative which also takes care of your problem with absolutely positioned elements inside it. The div becomes a layer, which means that any absolutely positioned element inside it will use the top left corner of the div as zero point, not the page.

    The border on the div is only to see where it is. You can remove that.

    The code is tested in Firefox 3, IE 7, IE 8 beta and Opera 9.

    <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://data.w3.org/TR/xhtml11/DTD/xhtml11.dtd'> <html xmlns='http://data.w3.org/1999/xhtml'> <head> <title>Center</title> <style type='text/css'> html { height: 100%; } body { margin: 0; padding: 0; height: 100%; } .Content {    width: 1128px; height: 567px;    margin: -283px auto 0; position: relative; top: 50%;    border: 1px solid #000; } </style> </head> <body>  <div class='Content'> </div>  </body> </html> 

    Edit:
    Here is the code with the contents and style pasted in:

    <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://data.w3.org/TR/xhtml11/DTD/xhtml11.dtd'> <html xmlns='http://data.w3.org/1999/xhtml'> <head> <title>Center</title> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /> <meta http-equiv='imagetoolbar' content='no'> <style type='text/css'>  html { height: 100%; } body { margin: 0; padding: 0; height: 100%; background-image: url(xxxbackground.gif); } .Content { width: 1128px; height: 567px; margin: -283px auto 0; position: relative; top: 50%; }  #divInteraction {         position:absolute;         width:640px;         height:480px;         z-index:1;         left: 460px;         top: 47px;         overflow: hidden; } #divVideo {         position:absolute;         width:424px;         height:284px;         z-index:2;         left: 13px;         top: 101px;         overflow: visible; } #imgInteraction { } #iframeInteraction { display: none; }  </style> </head> <body>  <div class='Content'>  <div id='divInteraction'>         <iframe id='iframeInteraction' width='100%' height='100%' ></iframe>         <img id='imgInteraction' src='powerpoint_pic_0.jpg' /> </div>    <div id='divVideo'>           <object id='wmvVideo' width='424' height='284' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95'   codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112' standby=''   type='application/x-ms-wmp' VIEWASTEXT>                  <param name='AutoSize' value='false' />                 <param name='ShowStatusBar' value='0' />                 <param name='DefaultFrame' value='x' />                 <param name='ShowControls' value='1' />                 <param name='ShowAudioControls' value='1' />                 <param name='ShowPositionControls' value='0' />                 <param name='ShowTracker' value='1' />                 <param name='ShowDisplay' value='0' />                 <param name='ShowCaptioning' value='0' />                 <param name='ShowGoToBar' value='0' />                 <param name='ControlType' value='2' />                 <param name='Autostart' value='1' />                 <param name='InvokeUrls' value='1' />                 <param name='AnimationAtStart' value='0' />                 <param name='TransparentAtStart' value='0' />                 <param name='SendStateChangeEv' value='1' />                 <param name='SendOpenChangeEv' value='1' />                 <param name='SendPlayChangeEv' value='1' />                 <param name='AllowChangeCtrlType' value='1' />                 <param name='AllowChangeDisplaySize' value='1' />                 <param name='AllowScan' value='1' />                 <param name='AutoRewind' value='1' />                 <param name='PlayCount' value='1' />                 <param name='Volume' value='0' />                        <param name='Filename' value='http://www.xxx.com/xxx/xxx.wmv'/>           <embed type='application/x-mplayer2'         pluginspage='http://www.microsoft.com/windows/windowsmedia/download/'         name='Player1NS'         AutoSize='false'         ShowStatusBar='0'         DefaultFrame='x'         ShowControls='1'         ShowTracker='1'         ShowDisplay='0'         ShowCaptioning='0'         ShowGoToBar='0'         Autostart='1'         AnimationAtStart='0'         TransparentAtStart='0'         PlayCount='1'         Volume='0'         Filename='http://www.xxx.com/xxx/xxx.wmv'         ShowAudioControls='1'         ShowPositionControls='0'                  width='424'         height='284'>         <br />    </embed>      </object>  </div>  </div>  </body> </html> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a header which I constructed like this: <header class=top> <a href=> <span
Greetings, I have a particular object which can be constructed from a file, as
Suppose, I have a lot of classes, which are constructed using Java reflection (for
Ok so I have constructed a working example of a client and server which
I have constructed a generic method which deserialiazes an object in the following manner:
I have constructed a PHP file which scrapes a web page (using cURL) to
I have constructed a simple Rest service using ServiceStack (which is brilliant), that returns
I have constructed the following query using NHibernate which will give me a collection
I have constructed a Swing Application that needs to be run from a browser.
I have constructed my first piece of software using QT and C++, which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.