Current location: Hot Scripts Forums » General Web Coding » CSS » page centering mess in .css

page centering mess in .css

Reply
  #1 (permalink)  
Old
Newbie Coder
 
Join Date: Aug 2009
Posts: 23
Thanks: 4
Thanked 0 Times in 0 Posts
page centering mess in .css

Hi guys and gals,

Am trying to center this page with .css, have looked up the appropriate commands etc. but it doesn't seem to be working. I suspect the commands are in conflict with something else going on with the page.

Can someone please check this code and tell me why these pages don't want to center?

THANKS IN ADVANCE...ALL HELP GREATLY APPRECIATED!

******************page code*****************************

<!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=utf-8" />
<title>Cornerstone Financial</title>
<style type="text/css">
<!--
*{
margin:0;
padding:10;
}


body {
background-image: url(bg1.jpg);
text-align:center;
}
#content {
width : 1000px;
margin:0 auto;
}


#apDiv1 {
position:absolute;
width:992px;
height:131px;
z-index:;
left: 139px;
top: 1px;
float: left;
}
#apDiv2 {
position:absolute;
width:341px;
height:115px;
z-index:2;
left: 531px;
top: 9px;
float: right;
}
.style1 {font-family: Arial, Helvetica, sans-serif;}
.style3 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: x-large;
}
#apDiv3 {
position:absolute;
width:984px;
height:24px;
z-index:1;
left: 137px;
top: 137px;
}
.style4 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: small;
}
#apDiv4 {
position:absolute;
width:900px;
height:400px;
z-index:6;
left: 131px;
top: 201px;
}
a:link {
color: #999999;
}
a:visited {
color: #FF9900;
}
.style7 {font-size: small}
.style8 {font-family: Arial, Helvetica, sans-serif; font-size: small; }
a:hover {
color: #FF9900;
}
-->
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<TITLE>Welcome to Cornerstone Financial Group</TITLE><style type="text/css">
.tbl {display:none;}.lnk {border:none;background:none;width:85px;}td {FONT-SIZE: 75%; MARGIN: 0px; COLOR: #000000;}td {FONT-FAMILY: verdana,helvetica,arial,sans-serif}a {TEXT-DECORATION: none;}.style9 {color: #999999}
.style10 {color: #FF0000}
a:link {
color: #999999;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #FF6600;
}
a:hover {
text-decoration: underline;
color: #FF0000;
}
a:active {
text-decoration: none;
color: #666666;
}
.style11 {color: #666666}
.style12 {font-family: Arial, Helvetica, sans-serif}
.style14 {font-family: Arial, Helvetica, sans-serif; font-size: small; }
.style16 {color: #999999; font-size: larger; }
.style17 {
font-size: 9px
}
</style></head>

<body><div id="content">
<div id="apDiv1">
<div align="center"><img src="spacer.gif" width="40" align="left"><img src="smallcornerstonelogo.jpg" align="left" /><span class="style1"><span class="style12"><strong><br />
A Firm Foundation for Your Financial Future.</strong><br />
Licensed, experienced full-service financial <br />
advisory for the high-net-worth client -<br />
</span></span><span class="style8 style12">and those who wish to become so</span><span class="style7 style12">.</span> <span class="style12"><br />
425-440-0699</span><br />
<br />
</div>
</div>
<div class="style4" id="apDiv3">
<div align="center">
<p><br />
<span class="style14"><a href="index.html">home</a> <img src="spacer.gif" /><a href="aboutcfg.htm">about</a><img src="spacer.gif" /> <a href="agents.htm">agents</a><img src="spacer.gif" /><a href="insurancepage.htm">insurance</a><img src="spacer.gif" /> <a href="investments.htm">investments</a><img src="spacer.gif" /> <a href="recruiting.htm">careers</a><img src="spacer.gif" /><a href="estate.htm">estate planning</a><img src="spacer.gif" /> <a href="resources.htm">resources</a><img src="spacer.gif" width="36" height="20" /><a href="contactcfg.htm">contact</a></span></p>
</div>
</div>
<div id="apDiv4">

<center>
<table cols="2" width="1000" border="0" cellpadding="10" cellspacing="0" bgcolor="#000000">
<tr>
<td width="460" height="181" align="center" valign="top"><script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','418','heigh t','181','src','cfgflash1','quality','high','plugi nspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movi e','cfgflash1' ); //end AC code
</script>
<noscript>
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="418" height="181">
<param name="movie" value="cfgflash1.swf" />
<param name="quality" value="high" />
<embed src="cfgflash1.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="418" height="181"></embed>
</object>
</noscript></td>
<td width="479" height="181" valign="middle" style="background: url(onlinequote.jpg) no-repeat 0 0;" />
<br />
<div align="right" style="style1"><span class="style11">Get an online quote here:</span> <br /><br />
<a href="lifeins.html">Life</a><br />
<br />
<a href="healthins.html">Health</a> <br />
<br />
</p>
</div>
</tr>

<tr>
<td colspan="2" class="style4"><div align="center"><span class="style16">At Cornerstone Financial Group, our greatest asset is our people. Our experienced, knowledgeable, personable agents and staff are equipped with state-of-the-art tools, working daily with some of the best financial vehicles, plans and systems available anywhere. We are wholly dedicated to helping you build security and prosperity for yourself, your business and your family. We provide our staff with professional, detailed training to make sure that each aspect of your experience with us is correct for your financial situation, your life plan and your risk/comfort level. We pride ourselves on our ability to LISTEN, so that each proposal, prospectus or rate quotation is clearly explained, easy to understand and based on your input, not solely on what WE THINK you should be doing. We look forward to helping you build your financial future on a firm foundation. </span><br />
<br />
</div></td>
</tr>
<tr>
<td><div align="center">
<p><img src="handshakesmall.jpg" width="161" height="144" align="left" /><span class="style10"><br />
&quot;But I already have a<br />
financial advisor&quot;</span><br />
</p>
<p><a href="aboutcfg.htm" class="style8">Find out <br />
HOW CORNERSTONE IS DIFFERENT <br />
</a><span class="style8">from your current advisor.</span><br />
</p>
</div></td>
<td>
<p align="right"><img src="sales-team3.png" width="216" height="144" align="left" /><span class="style8 style9"><br />
Cornerstone is growing!<br />
<a href="recruiting.htm"><br />
Find out if you <br />
have what it takes</a><br />
to join the professional <br />
advisory team here. </span></td>
</tr>
</table>
<table width="1000" border="0" align="center" cellpadding="3" cellspacing="0" bgcolor="#000000"><tr>
<td><p align="left" class="style18 style12 style9 style17"><span class="style18 style9 style17"><span class="style9">Securities and/or investment advisory services are offered solely through Ameritas Investment Corp. (AIC). Member FINRA/SIPC. AIC and Cornerstone Financial Group are not affiliated. Additional products and services may be available through Cornerstone Financial Group that are not offered through AIC. Securities products are limited to residents of Washington, California and New Hampshire.<br />
<br />
This is not an offer of securities in any jurisdiction, nor is it specifically directed to a resident of any jurisdiction. As with any security, request a prospectus from your Registered Representative. Read it carefully before you invest or send money. A Representative from Cornerstone Financial Group will contact you to provide requested information.<br />
</span><br />
Representatives of AIC do not provide tax or legal advice. Please consult your tax advisor or attorney regarding your situation.</span></p>
</td>
</tr>
</table>

</center></div></div></div>


</body>
</html>
Reply With Quote
  #2 (permalink)  
Old
Newbie Coder
 
Join Date: Nov 2011
Posts: 98
Thanks: 0
Thanked 9 Times in 9 Posts
first off #apDiv4 is 900 pixels wide while your table is 1000px. fix that. then find all the places in your css whare you've put
Code:
left:something
and remove them. also remove the <center> tags. that will take care of your problems.
Reply With Quote
  #3 (permalink)  
Old
Wannabe Coder
 
Join Date: Jun 2008
Posts: 122
Thanks: 2
Thanked 0 Times in 0 Posts
Looking at your code, me personally I would never use 'text-align:center' to center an entire website, I would never give my body a fixed width either. Give your content a 'container' DIV with a fixed width then use the auto margin which should align the content in the center.

Code:
HTML//

<div id='container'>
   THIS IS WHERE THE REST OF YOUR STUFF GOES
</div>

CSS//

#container{
   width:900px;
   margin:0 auto 0 auto;
}
Reply With Quote
Reply

Bookmarks

Tags
.css, centering


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
hyperlink generator shout it PHP 6 01-30-09 01:51 AM
[SOLVED] multiple forms in a single page id10tn00b HTML/XHTML/XML 2 10-09-08 12:26 AM
Suppress Sound in IE when a new Page Loads immortal_king JavaScript 3 10-11-06 09:04 PM
$_GET variable from previous page! truesilentassassin PHP 6 07-26-04 10:55 PM


All times are GMT -5. The time now is 07:01 AM.
vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.