View Full Version : Need some help centering my site....
bigvisfan
September 24th, 2005, 16:42
Hi all,
I am a beginer at web design. I've been tinkering for a while now, teaching myself. I just designed a website for my Uncle and I'm having trouble centering the pages in the browser window. Everything is symetrical, but it all gets pushed to the left. Anyone have any ideas on a html or java script I could put in my code so that each page will be centered in the browser window, instead of pushed to the left? Also, I don't know if this is possible, but I'd love it if there was some way that when you typed in the site address and hit enter, the browser window would automatically contour to the size only of the content of just the "enter" page? Does that make sense? :P
Here is the site address:
http://members.tripod.com/bremenman/
Like I said, I'm pretty green still. Lots to learn. So if ya'all could please keep the "you suck buddy's" to a minimum, that would be awesome :) j/k
thank you for reading,
Sam
technique™
September 24th, 2005, 18:02
Try this:
<center> <center>
tzyzhing
September 24th, 2005, 19:31
you meant <center><center>
littleswebhosting
September 24th, 2005, 20:10
:P lol....probably -> <center> </center>
bigvisfan
September 24th, 2005, 21:21
Forgot to mention that I did try <center> </center>, to no resolution. :x
Jon86
September 24th, 2005, 21:26
lol comone guys closeing tags technique™ and tzyzhing duh!
littleswebhosting is right, i took a look at your source code:
1. why are there like a million <br> lines even before the main body code starts? they r usesless sitting there lol and 2. id put thows center tags in the code like this, first find your body tag then place like so:
<body>
<center>
*****MAIN CODEING*****
</center>
</body>
if this dose not work as you say, is your site in tables? you may want to add align propertys to your tables to make it center eg <table align="center">
Jon86
September 24th, 2005, 21:37
oh and about that resizing of the browser to fit, well i might have a fix its a popup script that ive modifyed to load in the same window i have no idea if it will work thow
on (load) {
//customize the window that gets opened
// 0 equals NO.
// 1 equals YES.
address = "http://members.tripod.com/bremenman/";
target_winName = "_self";
// this is were you specify the width of the browser window
width = 700;
// this is were you specify the height of the browser window
height = 200;
toolbar = 1;
location = 1;
directories = 0;
status = 1;
menubar = 1;
scrollbars = 1;
resizable = 1;
//sends data back to the function
openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
}
put this only on the front page as the browser will keep its size plus as i said i got no idea if it will work but meh if any other java expert can expand on that it should help you out
if i was you i would leave the browser the size it is cause 1. when people leave your site the browser wont auto resize back unless you make another script that tells it to, or 2. they will have to resize it themselfs, in my opinion i would find it annoying to have to resize my browser window, but its your site, do what ever you want
bigvisfan
September 25th, 2005, 14:24
Jon,
Tried your advice from above, to no avail. I put all of the breaks in there so it would push the ads under my design. For some reason the ads were placed behind the design, when I applied the breaks it pushed the ads under and made it look ok. I used a little program called perfect website creator to build this page, some of the html coding is my own, but most of it was done automatically by the program. Seems kind of strange that the design was floating on top of the tripod ads though. Any more ideas to help get this sucker centered?
thanks,
Sam
CoogleX
September 25th, 2005, 14:46
<body>
<div align="center">
-----content-------
</div>
</body>
This works for me at all occassions
iBrightDev
October 3rd, 2005, 10:54
well, i was going to reply to the original post, but CoogleX said exactly what i would have said.
<html>
<head>
<title></title
</head>
<body>
<div align="center">
all your text and code here.
</div>
</body>
</html>
the other way you could try is to replace the <div align="center"> tag with <p align="center"> and or course replace </div> with </p>, but i prefer to use the <div> tag instead. It is a lot better way to code.
__________________________________________________
i was glancing at your site and noticed you used the <div> tag for all your text and pics. so neither the <div> or <p> tags will work for you. i have already tried to use them to impliment the code for you. you will have to recode your page. reason being is that you have given the <div> tage absolute positions in your css above. i have recoded it to help out a bit. it will work now, but the ret of the site codeing is up to you
_____________________________________________________
<!DOCTYPE HTML PUBLIC "-//WC3//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<NOSCRIPT>
<META HTTP-EQUIV="refresh" CONTENT="1; URL=My_Homepage_Files/noscript.html">
</NOSCRIPT>
<META NAME="KEYWORDS" CONTENT="">
<META NAME="DESCRIPTION" CONTENT="">
<TITLE>Bremenman</TITLE>
<STYLE TYPE="text/css">
.textstyle0 {font-family:Freestyle Script;font-weight:bold;font-style:normal;font-size:24pt;text-decoration:normal;color:#000000;}
.textstyle1 {font-family:Times New Roman;font-weight:normal;font-style:normal;font-size:12pt;text-decoration:normal;color:#000000;}
.textstyle2 {font-family:Freestyle Script;font-weight:bold;font-style:normal;font-size:18pt;text-decoration:normal;color:#000000;}
.textstyle3 {font-family:Times New Roman;font-weight:bold;font-style:normal;font-size:12pt;text-decoration:normal;color:#000000;}
.textstyle4 {font-family:Times New Roman;font-weight:bold;font-style:normal;font-size:8pt;text-decoration:normal;color:#808080;}
.textstyle5 {font-family:Arial;font-weight:bold;font-style:normal;font-size:10pt;text-decoration:normal;color:#000000;}
.textstyle6 {font-family:Arial;font-weight:normal;font-style:normal;font-size:10pt;text-decoration:normal;color:#000000;}
.textstyle7 {font-family:Verdana;font-weight:normal;font-style:normal;font-size:8pt;text-decoration:normal;color:#000000;}
</STYLE>
<STYLE TYPE="text/css">
DIV.Object216 { position:absolute; top:219px; left:168px; z-index:0; }
DIV.Object217 { background: url() no-repeat; }
DIV.Object218 { position:absolute; top:107px; left:133px; z-index:2; }
DIV.Object219 { position:absolute; top:429px; left:77px; z-index:3; }
DIV.Object220 { position:absolute; top:306px; left:48px; z-index:4; }
DIV.Object221 { position:absolute; top:45px; left:306px; z-index:5; }
DIV.Object222 { position:absolute; top:138px; left:259.5px; z-index:6; }
DIV.Object223 { position:absolute; top:157px; left:278.5px; z-index:7; }
DIV.Object224 { position:absolute; top:174px; left:340.5px; z-index:8; }
DIV.Object225 { position:absolute; top:194px; left:292.5px; z-index:9; }
DIV.Object226 { position:absolute; top:216px; left:211.5px; z-index:10; }
DIV.Object227 { position:absolute; top:40px; left:495px; z-index:11; }
DIV.Object228 { position:absolute; top:316px; left:41px; z-index:12; }
DIV.Object229 { position:absolute; top:407px; left:39px; z-index:13; }
DIV.Object230 { position:absolute; top:279px; left:816px; z-index:14; }
DIV.Object231 { position:absolute; top:378px; left:615px; z-index:15; }
</STYLE>
</HEAD>
<body LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 BGCOLOR="#ffffff" LINK="#0000ff" VLINK="#800080">
<div align="center">
<br>
<br>
<br>
<table width="719" border="0" cellspacing="5" cellpadding="5">
<tr>
<td colspan="3"><div align="center"><SPAN CLASS="textstyle0">The Bremen Man & Meadowbrook Studios<br><IMG SRC="http://members.tripod.com/bremenman/My_Homepage_Files/IMG_0.jpg" WIDTH=549 HEIGHT=1 BORDER=0>
</span></div></td>
</tr>
<tr>
<td colspan="2" ><div align="center" class="textstyle1">In the 60's he played with the "Playmates".<br>
and NOW.....<span class="textstyle2"><br>
THE BREMEN MAN</span><br>
Performs music for the ages...Rock, Country, and R&B!!!<span class="textstyle3"><br>
Also: Karaoke by Meadowbrook Studios!</span></div></td>
<td width="306" rowspan="2">
<DIV class="Object217"><IMG SRC="http://members.tripod.com/bremenman/My_Homepage_Files/IMG_1.jpg"><br>
<span class="textstyle4">Mark Henry Allerheiligen "The Bremen Man"</span>
</DIV>
</td>
</tr>
<tr>
<td colspan="2" class="textstyle1"><div align="center"><a href="http://members.tripod.com/bremenman/My_Homepage_Files/Page1.html" onMouseOver='img_mo0.src="http://members.tripod.com/bremenman/My_Homepage_Files/IMG_5.jpg"' onMouseOut='img_mo0.src="http://members.tripod.com/bremenman/My_Homepage_Files/IMG_4.jpg"'><img src="http://members.tripod.com/bremenman/My_Homepage_Files/IMG_4.jpg" name="img_mo0" width=333 height=175 border=0></a></div></td>
</tr>
<tr>
<td colspan="3"><IMG SRC="http://members.tripod.com/bremenman/My_Homepage_Files/IMG_0.jpg" WIDTH=549 HEIGHT=1 BORDER=0></td>
</tr>
<tr>
<td width="331" height="29"><SPAN CLASS="textstyle5">Contact Mark or Dawn Allerheiligen (785) 767-3766</span></td>
<td colspan="3"><SPAN CLASS="textstyle5">E-mail</SPAN><SPAN CLASS="textstyle6">:</SPAN><SPAN CLASS="textstyle7"> <A HREF="mailto:dan-mar@diodecom.net">dan-mar@diodecom.net</a></span> <SPAN CLASS="textstyle5">www.bremenman.com</span></td>
</tr>
</table>
</div>
</body>
</HTML>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script>
ced
October 3rd, 2005, 13:58
Index Good
R4g1ng
October 4th, 2005, 00:47
I use CSS to center stuff.
put this in your body {} in your css. This is so it works in IE.
text-align: center;
Make sure that in your tables and stuff you change the alignment or it'll be centered.
Then have this in your css.
.centered {
margin: 0 auto;
}
After that you just put class="centered" in the tags.
cronic5
October 5th, 2005, 22:40
Yeah, I always use the <div align="center"> when aligning many things and can't use the <center></center> tags because they are already used soemwhere else in that area of code.
And I HIGHLY suggest a new host. Even freewebs.com would be better. But if you are looking for real host, you can always request somewhere in the forums. If you need some help finding any hosting I would be more than happy to help, just catch me on AIM cronic8350. That is, if you have AIM.
So, good luck in finding a host and with your website.
instanthosting
October 6th, 2005, 08:57
I WOULD BE MORE THAN HAPPY TO OFFER YOU HOSTING FOR YOUR SITE, WITH A 14 DAY MONEY BACK GUATANTEE WWW.-------------------
iBrightDev
October 13th, 2005, 11:25
i will supply a host and one year free domain once your domain expires. check http://www.methodcomptech.com
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.