PDA

View Full Version : center text on "about" page - Simple Visions


akvin
10-19-2006, 09:12 PM
Hello everybody,

Im at a loss how to center the text on the About page on my site (http://pix.philipus.com/index.php?x=about). The code says:

"<div id="page"><table width="85%"><tr><td class="column"><h3>Welcome friends!</h3><p><div align="justify">Have look"

I guess I could add something to the table tag, but what?

Also, how do make a little bit bigger space between the two columns?

Thank you very much
akvin

feanne
10-20-2006, 04:30 AM
Hi akvin,

There are two ways to go about this:
1. edit your template CSS
2. edit the HTML itself

(This is a matter of personal preference, but I think if you want your site pages to be validated on W3C then you should use the CSS method. Personally I'd go with the CSS method, but if you just want a quick fix just edit the HTML. Also note that there are alternative ways of implementing the given methods, I'm just going to describe how I myself would go about it.)

*** *** ***

1. editing the CSS:

- edit the HTML in the About page to say, <div id="page" class="aboutpage">

- input this CSS in your template stylesheet:
.aboutpage { text-align: center; }
.aboutpage table { margin: auto; }
.aboutpage table td.column { margin-left: 10px; margin-right: 10px; }

- I haven't tried that but it *should* work. As you can see the last line of code is the one that puts space between the two columns; you can fiddle with those numbers until you get enough space.

- EDIT: I modified the last CSS line a bit.

*** *** ***

2. editing the HTML:

- put <center> before the <table> tag, like so:
<center><table width="85%">

- put </center> after the </table> tag, like so:
</table></center>

- I think <center> is a deprecated HTML tag though, so you might want to use
<p align="center"> and </p> instead of <center> and </center>.
Or <div style="text-align:center;"> and </div> instead of <center> and </center>.

- I also haven't tried that code but it *should* work.

*** *** ***

Hope that helps. :)

akvin
10-22-2006, 11:34 AM
Thanks a tonne, Feanne. Sterling - the css option works.