Forum Moderators: not2easy

Message Too Old, No Replies

centering a DIV, or DIV content......

is what FrontPage doing correct and is there a better way....

         

Shadows Papa

4:09 pm on Oct 29, 2003 (gmt 0)

10+ Year Member



When I upgraded to FP XP many months ago, I note that when I have it create a table, and tell it to center that table, it does so by surrounding the table with:

<div align="center">
<center>
<table here, blah, blah>
</table>
</center>
</div>

The end result is fine - my table is centered.

Is there a better way? My default is to center all tables.
I handle the text outside of tables with things like this in my external style sheet file (where "about" is a paragraph I put at the top of a page describing us or that page):

h3 {
font-FAMILY: "Comic Sans MS", Verdana, Arial, Helvetica, sans-serif;
font-SIZE: 22px;
COLOR: #000099;
text-align: center;
font-weight: normal;
font-style: normal;
margin-top: 0px;
margin-bottom: 0px;
padding-top: 0px;
padding-bottom: 0px;
}

.about {
font-FAMILY: Verdana, Arial, Helvetica, sans-serif;
font-SIZE: 14px;
COLOR: #000000;
text-align: center;
font-weight: normal;
margin-top: 1px;
margin-bottom: 4px;}

Shadows Papa
(the stylesheet file itself has even shrunk with tips from folks here)

DrDoc

4:15 pm on Oct 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are lots of other ways you can center a table:

{
position: relative;
left: 50%;
margin-left: -25%;
}

{
margin: 0 auto;
}

As for your style sheet, it can be shortened to:

h3 {
font: normal 22px "Comic Sans MS", Verdana, Arial, Helvetica, sans-serif;
color: #009;
text-align: center;
margin: 0;
padding: 0;
}

.about {
font: normal 14px Verdana, Arial, Helvetica, sans-serif;
color: #000;
text-align: center;
margin: 1px 0 4px;
}