Click to See Complete Forum and Search --> : How do I center my sites
wgroves21
10-25-2005, 10:12 PM
I have built several websites using Dreamweaver, but I'm not as proficient at HTML as I would like. As a result, some sites I have built seem to be off center- usually a left of center. What is the code to get my sites centered, regardless of who views them?
Kravvitz
10-25-2005, 11:26 PM
How to Center Elements with CSS (in IE5+/Win and other browsers) (http://www.dynamicsitesolutions.com/css/center_element/)
sitehatchery
10-26-2005, 09:01 AM
Between the <body> tags, create one table with one row/column, and stick everything else inside. That's how I usually do it.
<body>
<table align="center">
<tr>
<td>
... other html here
</td>
</tr>
</table>
</body>
the tree
10-26-2005, 10:29 AM
Or if you don't want extraordinary amounts of markup:<body style="text-align:center;">works to the same affect.
GusJustGus1
10-27-2005, 10:46 AM
There are many ways to center text, images, and everything else in many different codes... the above ways work as well as the unmentioned ways. How I'd been doing it since Middle School oh so many years ago was
<center>
</center>
And just withing in the past 2 years I fell in love with Tables, so I'd been using the first suggestion.
The <center> code though, is still the easiest I've ever known. It works with just about any code at any time.
Brollachan
10-27-2005, 11:50 AM
The <center> tags are deprecated in HTML 4.0 and beyond, and therefore shouldn't be used.
See: http://www.w3.org/TR/html401/appendix/changes.html#h-A.3.1