Jump to content

Alignment Problem


raviprakashg

Recommended Posts

i using 1024x 768 resolution as My desktop and Site's Page Layout Is 800x600, and he Layout is aligmed center in Browser window. Problem is The align Center is working Properly in IE but in Firefox it stay in left, what should i do to may it centre in both browser

<div class="Div" >  <table width="780" border="0" cellpadding="0" cellspacing="0" bgcolor="#AFCAE4" id = "font3">    <tr bgcolor="#AFCAE4">       <td> |<a href="Index.asp">Home</a>|<a href="ShowProduct.asp?PC=''&Pk=''">View Product</a>         |<a href="Dealers.asp">Dealer</a>|<a href="Contact.asp">Contact</a>         |</td>      <td> </td>     </tr>  </table></div>[B]CSS : (External File)[/B]body {	margin:0px 1px; font-family: Verdana, Geneva, Arial, helvetica, sans-serif;	SCROLLBAR-FACE-COLOR: #f2f9fd;	SCROLLBAR-HIGHLIGHT-COLOR:#f2f9fd;	SCROLLBAR-SHADOW-COLOR: #336699;	SCROLLBAR-ARROW-COLOR: #336699;	SCROLLBAR-BASE-COLOR: #f2f9fd;	scrollbar-dark-shadow-color: #336699;	scrollbar-3d-light-color: #f2f9fd;	text-decoration: none;	font-size: 11px;	font-style: normal;	align : center;	color : #000000;	background-attachment: scroll;	background-image: url('Images/BG1.jpg');	background-repeat: repeat-y;	background-position: left top;	list-style-position: outside;	list-style-type: square}.Div { align : center; text-align: center}

Link to comment
Share on other sites

align: center

the above CSS is not supported by any browser, it will only work as an HTML elementlike so:

table align="center"

Try this instead:

<div class="Div" align="center">  <table width="780" border="0" cellpadding="0" cellspacing="0" bgcolor="#AFCAE4" id = "font3" align="center">    <tr bgcolor="#AFCAE4">       <td> |<a href="Index.asp">Home</a>|<a href="ShowProduct.asp?PC=''&Pk=''">View Product</a>         |<a href="Dealers.asp">Dealer</a>|<a href="Contact.asp">Contact</a>         |</td>      <td> </td>     </tr>  </table></div>

CSS:

body {	margin:0px 1px; font-family: Verdana, Geneva, Arial, helvetica, sans-serif;	SCROLLBAR-FACE-COLOR: #f2f9fd;	SCROLLBAR-HIGHLIGHT-COLOR:#f2f9fd;	SCROLLBAR-SHADOW-COLOR: #336699;	SCROLLBAR-ARROW-COLOR: #336699;	SCROLLBAR-BASE-COLOR: #f2f9fd;	scrollbar-dark-shadow-color: #336699;	scrollbar-3d-light-color: #f2f9fd;	text-decoration: none;	font-size: 11px;	font-style: normal;	color : #000000;	background-attachment: scroll;	background-image: url('Images/BG1.jpg');	background-repeat: repeat-y;	background-position: left top;	list-style-position: outside;	list-style-type: square}.Div {text-align: center}

If that doesn't work then use the good old <center> and </center> tags. though I don't think it will vaildate with a strict dtd.

i using 1024x 768 resolution as My desktop and Site's Page Layout Is 800x600, and he Layout is aligmed center in Browser window. Problem is The align Center is working Properly in IE but in Firefox it stay in left, what should i do to may it centre in both browser
Link to comment
Share on other sites

Align the text in an element:

text-align: center;

Align the element itself:

margin: 0 auto;

That should work... and really... remove the "align: center".

Link to comment
Share on other sites

since you are not using CSS at more detail, why dont you just type your HTML <table align="center" ... > ....I think that will do the job..But since you are considering of using CSS, and this thread is in the CSS category, I would strongly advise you to check out one of the previous topics on CSS Vs Table layouts.....and although somehow 'cool', the scrollbar should not be edited, according to W3C

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...