PDA

View Full Version : Why Won't My Text Center?


tvaughn05
05-30-2006, 09:14 PM
Hi there, I'm designing a website, and I can't get the text in a table I created to center. It centers in Firefox, but in IE, it just looks horrible. Here is my HTML Code, and my CSS Code. Its probably very easy, but I am new to CSS...

Thanks a bunch!

Tony

HTML Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<TITLE>Saint Edwards Catholic School</TITLE>
<META NAME="Author" "T. Vaughn">
<META NAME="Description" CONTENT="The official website for Saint Edwards Catholic School in Lowell, Indiana. We are a faith-based community.">
<META NAME="Keywords" CONTENT="saint,edward,catholic,school,schools,private,lowell,indiana,st.,st,parish,northwest,diocese,of,gary, tvaughn05">
<META NAME="Generator" CONTENT="Macromedia Dreamweaver MX">
<META NAME="Language" CONTENT="English">
<META NAME="Robots" CONTENT="All">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="project.css" rel="stylesheet" type="text/css">
</head>
<body background="bg2.gif" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle" id="header"><table border="0" align="center" cellpadding="20" cellspacing="0" id="mainTable">
<tr>
<td height="1" bgcolor="#FFFFFF"><p><img src="stedslogocrayontop.gif" width="413" height="153"></p>
<p align="center"><img src="navbar_r1_c1.gif" alt="Information" name="Information" width="115" height="20" id="Information"><img src="navbar_r2_c2.gif" width="1" height="1"><img src="navbar_r1_c2.gif" alt="Homework" name="Homework" width="107" height="19" id="Homework"><img src="navbar_r1_c4.gif" alt="Teachers" name="Teachers" width="92" height="20" id="Teachers"><img src="navbar_r1_c6.gif" width="1" height="20"><img src="navbar_r1_c7.gif" alt="Contact" name="Contact" width="85" height="20" id="Contact"></p></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" id="sidebar"><p align="center">&nbsp;</p>
<p align="center"><font color="#000000"><strong><font face="Georgia, Times New Roman, Times, serif">Saint
Edwards Catholic School</font></strong></font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">is
a Catholic elementary school</font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">located
in Lowell, Indiana that</font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">prides
itself on a Christian, value-centered curriculum</font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">in
a family-life atmosphere, high educational standards </font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">while
meeting individual needs and learning styles, </font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">participation
in academic and sports competitions, a</font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">qualified,
caring, experienced faculty, and providing a </font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">variety
of teaching techniques, including cooperative</font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">learning.</font></p>
<p align="center">&nbsp;</p>
<p align="center"><font color="#000000"><strong><font face="Georgia, Times New Roman, Times, serif">Our
Curriculum consists of:</font></strong></font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">Religion,
Spelling, Art, Computers, Science, </font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">Reading,
Physical Education, Family Life Program, </font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">Handwriting,
Mathematics, Music,</font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">
Language Arts, Social Studies/Indiana History, </font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">and
Health/Substance Abuse Education.</font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif"><strong><br>
Saint Edward School is:</strong></font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">Accredited
by the State of Indiana, under the</font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">
direction of the School Office, Diocese of Gary, a member</font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">of
the National Catholic Education Association, and</font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">a
member of the Indiana Non-Public</font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">Education
Association.</font></p>
<p align="center">&nbsp;</p>
<p align="center"><font color="#000000"><strong><font face="Georgia, Times New Roman, Times, serif">Our
Mission Statement:</font></strong></font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">St.
Edward School, in cooperation with</font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">the
Catholic Faith Community,</font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">fosters
in its students a Christian</font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">Attitude
that enables them to become</font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">active
participants in the Church,</font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">and
society, as well as providing an opportunity</font></p>
<p align="center"><font color="#000000" face="Georgia, Times New Roman, Times, serif">for
academic excellence.</font></p>
<p align="center"><img src="stedslogocrayonbottom.gif" width="413" height="153"></p></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

CSS Code

body {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 14px;
background-image: url(bgblak.gif);
margin: 0px 10%;
padding: 0px;
}
#mainTable {
border: 1px solid #000000;
/*/*/line-height: 1.5em; /* */
}
#mainTable td {
padding: 20px;/*Pads each table cell in modern browsers*/
}
#maincontent {
border-left: 2px dotted #333;
font-size: 14px;
/*/*/font-size: 100%; /* */
}
#sidebar {
width: 200px;
font-size: 12px;
/*/*/font-size: 85%; /* */
}

tvaughn05
05-30-2006, 10:01 PM
Never Mind, I figured it out...My CSS now is
body {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 14px;
background-image: url(bgblak.gif);
margin: 0px 10%;
padding: 0px;
text-align: center;
margin: 0 auto;

}
#mainTable {
border: 1px solid #000000;
/*/*/line-height: 1.5em; /* */
{ text-align: center }
margin: 0 auto;
}
#mainTable td {
padding: 20px;/*Pads each table cell in modern browsers*/
{ text-align: center }
margin: 0 auto;
}
#maincontent {
border-left: 2px dotted #333;
font-size: 14px;
/*/*/font-size: 100%; /* */
{ text-align: center }
margin: 0 auto;
}
#sidebar {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 14px;
margin: 0px 10%;
padding: 0px;
text-align: center;
margin: 0 auto;
}

Thamior
05-30-2006, 10:02 PM
wherever you want your text centered. add text-align="center" to that part of the CSS, so
.maincontent{
text-align="center";
}

Edit:
not needed...

_Aerospace_Eng_
05-30-2006, 11:54 PM
and its text-align:center; not text-align="center"

Thamior
05-31-2006, 06:22 AM
and its text-align:center; not text-align="center"
lol, guess i'm giving bad advice...wow why did I even put that....hmmm......wow.....thats just wrong..... well its times like these where one :lol: just laughs at ones self and moves along...