Re: HTML Question

by WebProgrmr(at)aol.com

 Date:  Thu, 27 Jan 2000 19:50:52 EST
 To:  JuliaS(at)munet.com,
hwg-techniques(at)hwg.org
  todo: View Thread, Original
>I was able to accomplish horizontal centering via the "center" tag... how
>can I center vertically?

Julia,
My thought would be to use Frames above and below the meat of your page.  The 
Tables solution is fine, if you use a fixed table size -- fixed height & 
width attributes.  But there are problems with this...  See code and 
explanation below:

<table width = 500 height = 500)
<tr>
<td valign="middle" align="center">

... blah, blah, blah...

</td>
</tr>
</table>

Problem: How do you know that you're user's screen is only going to be 500 x 
500?  If it's 2000 pixels high, your user is still going to see the log-on 
off center toward the top.

Instead, do this with Frames:  (you'll have to deal with the wrath of Frames 
haters)


<HTML>
<HEAD>
<TITLE>Your site</TITLE>
</HEAD>


<!-- This frameset creates rows and centers the defined area (400pixels) in 
the middle as center -->
<FRAMESET ROWS="1*,400,1*"> 
  
<!-- I referenced an html doc that filled this frame with nothing but black. 
-->
  <FRAME SRC= "black.html">


<!--  This frameset takes the center row and divides it into columns 
centering the defined area (600pixels) -->
  <FRAMESET COLS="1*,600,1*" FRAMEBORDER="NO" FRAMESPACING="0" BORDER="0"> 
    <FRAME SRC="black.html">

<!-- content of the 600 x 400 pixel centered frame -->
    <frame src="main.html">

    <FRAME SRC="black.html">
  </FRAMESET>

  <FRAME SRC="black.html">
</FRAMESET> 
<NOFRAMES> 
<BODY BGCOLOR=#FFFFFF>

<H2>You.com</H2>
If you're able to see this text, you're browser is not able to view this 
website.  To reach the site administrator contact, <a href="mailto:[email 
address here]">click here.</a> 
</BODY>
</NOFRAMES> 
</HTML>

Within the frame & frameset tags, you can add  MARGINHEIGHT="0" 
MARGINWIDTH="0" SCROLLING=NO frameborder="NO" whenever it's appropriate.  
Customize it however you like.

++Dan

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA