Log in

View Full Version : help with screen centered



baongoc
01-04-2008, 11:33 PM
Dear all,

This is my website: http://nguyenthaihoc.org/temp-site/

and need your help:)

1. Currently, the site is displayed starting from the left side of monitor's screen.
2. Now, I want it displayed in the center of the screen instead.
3. When I used a code from this forum,

"position:relative; margin-right: auto; margin-left: auto"

some is displayed at the center of the screen, except...

4. The menu and other cells (like PAYPAL sign) from the left side of the site do not move, and I don't know how to do it. Please help.

5. Do we have to go to every single page to change the code or there is a global one that we just change one time and it works for the entire site?

Thank you much for your help.

bn

A800
01-06-2008, 12:52 AM
In the table coding, add


align="center"

Where you got your table coding. like this:


<table width="800" height="100%" border="0" cellpadding="0" cellspacing="0" align="center">


I hope this helps.

baongoc
01-06-2008, 02:11 AM
A800,

Thanks. I did as you said. The main frame is centered but other stuffs like the menu doesn't move into place. Here it is:

http://www.nguyenthaihoc.org/temp-site/index.php

Please help.
Thanks

Rohan72
01-06-2008, 02:18 AM
This will NEVER work.

You have put 2 (two) html pages into one.

A page must have only ONE start and end tag (<html> </html>)

On the page u have now, after u ended the 1st page (with the closing tag </html>, u start another one (by using the opening tag <html> again).

It's like printing out 2 pages on the same side of a piece of paper.

baongoc
01-06-2008, 03:50 AM
Thanks Rohan72.

I am able to make thus far, the "Make A Donation" sign and the cell below it are moved into the place as can be seen here

http://http://www.nguyenthaihoc.org/temp-site/index.php

However, the menu is not. It seems that "the menu" is not generated by a html code. In the html page it has these lines:

<script type='text/javascript' src='exmplmenu_var.js'></script>
<script type='text/javascript' src='menu_com.js'></script>

So we have to change the javascript code somehow to move "the menu"? Please help.

bn

Rohan72
01-06-2008, 03:55 AM
No, U have got get rid of the double page.
What u have is in fact something like this :


<html>
<head></head>
<body></body>
</html>

<html>
<head></head>
<body></body>
</html>


The second part cannot be there

u have to get the content out of the second part and move it into the first part so it looks like this

<html>
<head></head>
<body></body>
</html>

baongoc
01-06-2008, 05:59 PM
Hi Rohan72,

The page has only this:


<html>
<head></head>
<body></body>
</html>

and still not working.

Rohan72
01-06-2008, 08:27 PM
U dont seem to get it...

U only removed a closing </html> tag.
What i was trying to explain was that EVERYTHING after that tag u removed cannot be there.
Let me try to explain.
A document opens with the opening <HTML> tag.
That is followed with an opening <HEAD> tag.
After this opening <HEAD> tag, u put all the things that will not be visible onscreen, like <META>, <TITLE></TITLE>, <LINK>, <SCRIPT></SCRIPT>, etc.
Then u close this section with </HEAD>

Thereafter U open the part of the document that u will actually see on screen with the <BODY> tag.
Now u put in all the things that u would like to appear on screen and close that part with the </BODY> tag.
Then u close the whole document with </HTML>

so each of the following tags can only be placed in a document one time:
<html> <head> </head> <body> </body> </html>

I suggest u take a look at the sourcecode of another site (like one u are looking at now) to get the idea

baongoc
01-06-2008, 09:41 PM
Hi Rohan72,

I think I understood what you have explained. Here is the code:


<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<title>Nguyen Thai Hoc Foundation</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<script type='text/javascript' src='exmplmenu_var.js'></script>
<script type='text/javascript' src='menu_com.js'></script>
<noscript>Your browser does not support script</noscript>
<table width="800" height="100%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="175" align="left" valign="top"><table width="90%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="81" align="center" valign="top" background="images/top.gif" class="heading" style="background-repeat:repeat-x"><img src="images/title.gif" width="175" height="79"></td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="#9A0000"><p>&nbsp;</p>


<p>&nbsp;</p>

<p align="center"><div id="bv_" style="position:absolute;left:17px;top:628px;width:126px;height:35px;z-index:8" align="left">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="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AKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA3MDYwNTIzMTc1NlowIwYJKoZIhvcNAQkEMRYEFI8BF5qCq2QL1Bye3lrJNzKLxsoFMA0GCSqGSIb 3DQEBAQUABIGAvnR24Mr/MVCIPPb499pqWbSiSg5zkCNS9eoJhdWMqJX3IKyC/LSWq64694eq/2QVRXs0USuQFgbkbDNXT/oJng7yFXXsMuwEBOjKluUwOSJS8J8A0bXWpNLXdMiLI9W02BXWgwBPIRo5uSKs6lXFJ13Kj2NddeL6MVMqdTTNqkg=-----END PKCS7-----
">
</form></div>
</div></p><p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>

<p>&nbsp;</p></td>
</tr>
<tr>
<td height="82" align="left" valign="top" background="images/bottom.gif" style="background-repeat:repeat-x;">&nbsp;</td>
</tr>
</table></td>
<td width="476" align="left" valign="top" bgcolor="#FFFFFF"><table width="94%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="54" bgcolor="#000000">&nbsp;</td>
</tr>
<tr>
<td height="99" align="left" valign="top"><img src="images/intro01.jpg" width="476" height="171"></td>
</tr>
<tr>
<td height="99" align="left" valign="top"><img src="images/welcome.gif" width="476" height="99"></td>
</tr>
<tr>
<td height="100" align="left" valign="top" background="images/pgbg.gif" class="texts"><p>&nbsp;</p>
<p><strong>NGUYỄN THÁI HỌC FOUNDATION</strong> là một tổ chức vô-vụ-lợi gồm những thiện-nguyện-viên nhằm mục đích thực hiện hai nhiệm vụ chính:</p>
<p>Nhiệm vụ thứ nhất là t́m kiếm, thu thập và bảo tồn những tài liệu, di sản cùng tất cả văn kiện liên quan đến cuộc đời và thành tựu của một sinh viên, một sáng lập viên và lănh tụ của Việt Nam Quốc Dân Đảng, và là một trong những nhà cách mạng trẻ tuổi nhất đầu thế kỷ 20, đó là </p>
<p>&nbsp;</p>
<p><A href="m_nguyenthaihoc.php">anh hùng dân tộc NGUYỄN THÁI HỌC</A></p>
<p>&nbsp;</p>
<p>Nhiệm vụ thứ hai của Foundation nhằm duy tŕ và phát huy TINH THẦN NGUYỄN THÁI HỌC xuyên qua những hoạt động thiện nguyện, đặc biệt là giúp đỡ phương tiện cũng như hướng dẫn giới thanh thiếu niên Việt Nam trong các lănh vực Văn Hóa, Khoa Học và Xă Hội. Nhiệm vụ này đă được khởi động vào tháng 12 năm 2004. Học bổng Nguyễn Thái Học hiện nay là một trong những hoạt động chính của Hội.</p>
<p>&nbsp;</p>
<p><em>Nguyễn Thái Học Foundation được tổ chức và hoạt động hoàn toàn v́ mục đích thiện nguyện, đang đệ nạp xin thể chế 501 (c) (3) của Bộ Luật Thuế Vụ và mọi đóng góp sẽ được hồi tố miễn thuế sau khi được Liên Bang Hoa Kỳ chấp thuận. </em></p>
<p><br>
</p></td>
</tr>

<tr>
<td height="53" align="left" valign="top"><img src="images/footer.gif" width="476" height="53"></td>
</tr>
<tr>
<td height="66" align="center" valign="middle" bgcolor="#000000" class="copyright">Nguyen Thai Hoc Foundation @copyright. All Rights Reserved.</td>
</tr>
</table></td>
<td width="149" align="left" valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="81" align="left" valign="top" background="images/top.gif" style="background-repeat:repeat-x">&nbsp;</td>
</tr>
<tr>
<td align="left" valign="top" background="images/bg.gif"><table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td height=26></td>
</tr>
<tr>
<td><div align="center"><a href="p_side1.html" target="_blank"><img src="picshd/side1.jpg" width="110" height="77" border="0"></a></div></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="center"><a href="p_side2.html" target="_blank"><img src="picshd/side2.jpg" width="110" height="77" border="0"></a></div></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="center"><a href="p_side3.html" target="_blank"><img src="picshd/side3.jpg" width="110" height="86" border="0"></a></div>
<div align="center"></div></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="center"><a href="p_side4.html" target="_blank"><img src="picshd/side4.jpg" width="110" height="82" border="0"></a></div></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="center"><a href="p_side5.html" target="_blank"><img src="picshd/side5.jpg" width="110" height="76" border="0"></a></div></td>
</tr>


<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="center"><a href="p_side6.html" target="_blank"><img src="picshd/side6.jpg" width="110" height="89" border="0"></a></div></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>


</td>
</tr>
<tr>
<td height="82" align="left" valign="top" background="images/bottom.gif" style="background-repeat:repeat-x;">&nbsp;</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>


and here how it is displayed http://nguyenthaihoc.org/temp-site/index_back.php