[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r14034 - trunk/www

From: Martin Tomes <lists_at_tomes.org>
Date: 2005-04-11 13:26:21 CEST

Max Bowsher wrote:
> Martin Tomes wrote:
>
>> maxb@tigris.org wrote:
>>
>>> Author: maxb
>>> Date: Fri Apr 8 07:04:33 2005
>>> New Revision: 14034
>>> Log:
>>> Some more webpage markup tweaks, this time heading in the direction of
>>> XHTML 1.0 Strict validity, but not going all the way there, because I
>>> have
>>> been unable to find any way to center-align a table using CSS.
>>
>> You don't say what you tried so you may have already done this.
>> Centering in CSS is done by setting the margins to auto:
>>
>> margin-left: auto;
>> margin-right: auto;
>>
>> If you set these on the table it might center.
>
>
> Well..... that's ridiculously non-intuitive.

Welcome to CSS!

I have attached a patch (relative to the www directory) which gets rid
of all center tags and align="center" attributes.

When the item to be centered is an inline item like an img or header or
normal text then the containing block item needs "text-align: center".

When the item to be centered is a block level item like a div then that
div needs it's left and right margins set to auto. Think of it like a
spring on each side of the div attaching it to it's container - it will
end up in the middle. IE complicates things a little, if you set
text-align: center it will also center block items inside it when it
should not.

I removed the table which you were trying to center because you don't
need it, styling the containing div is much simpler and achieves the
same end.

I have tested the pages in IE 6 and Firefox 1.0.2.

-- 
Martin Tomes
echo 'martin at tomes x org x uk'\
  | sed -e 's/ x /\./g' -e 's/ at /@/'
The Subversion Wiki is at http://www.subversionary.org/

Index: subversion-linus.html
===================================================================
--- subversion-linus.html (revision 14100)
+++ subversion-linus.html (working copy)
@@ -16,7 +16,7 @@
 <body>
 <div class="app">
 
-<h2 align="center">Please Stop Bugging Linus Torvalds About Subversion</h2>
+<h2 style="text-align: center">Please Stop Bugging Linus Torvalds About Subversion</h2>
 
 <p>Since Linus Torvalds' <a
 href="http://lwn.net/Articles/130681/">decision</a> to stop using
Index: project_issues.html
===================================================================
--- project_issues.html (revision 14100)
+++ project_issues.html (working copy)
@@ -37,7 +37,7 @@
 
 <div class="alert" style="color: black; font-size: 130%; font-weight: bold">
 
-<p align="center" style="font-size: 200%; color: red">
+<p style="font-size: 200%; color: red; text-align: center">
 Before filing a new issue, please:
 </p>
 
Index: project_packages.html
===================================================================
--- project_packages.html (revision 14100)
+++ project_packages.html (working copy)
@@ -74,19 +74,11 @@
 </ul>
 
 
-<div align="center">
-<table border="0" cellpadding="2" cellspacing="2" width="98%"
- style="background-color: white">
-<tr>
-<td width="100%" style="background-color: yellow; color: red">
-<b>
+<div style="width: 97%; margin-left: auto; margin-right: auto; background-color: yellow; color: red; font-weight: bold; padding: 2px">
 Subversion versions up to and including 1.0.7 and 1.1.0-rc3 have a <a
 href="/security/CAN-2004-0749-advisory.txt">flaw that fails to protect
 metadata when using mod_authz_svn.</a>. Servers running mod_authz_svn are
 advised to upgrade to the latest releases in the 1.0.x or 1.1.x lines.</b>
-</td>
-</tr>
-</table>
 </div>
 
 <hr />
@@ -107,7 +99,7 @@
 
 <hr />
 
-<h1 align="center">
+<h1 style="text-align: center">
 <a name="binary-packages"></a>
 Binary Packages
 </h1>
Index: propaganda.html
===================================================================
--- propaganda.html (revision 14100)
+++ propaganda.html (working copy)
@@ -16,7 +16,7 @@
 <body>
 <div class="app">
 
-<h2 align="center">Subversion Testimonials Redirect Page</h2>
+<h2 style="text-align: center">Subversion Testimonials Redirect Page</h2>
 
 <p>The Subversion Testimonials page has moved to
    <a href="testimonials.html">testimonials.html</a>.</p>
Index: project_faq.html
===================================================================
--- project_faq.html (revision 14100)
+++ project_faq.html (working copy)
@@ -16,7 +16,7 @@
 <body>
 <div class="app">
 
-<h2 align="center">Subversion FAQ Redirect Page</h2>
+<h2 style="text-align: center">Subversion FAQ Redirect Page</h2>
 
 <p>The Subversion FAQ has moved to faq.html.</p>
 
Index: svn_1.1_releasenotes.html
===================================================================
--- svn_1.1_releasenotes.html (revision 14100)
+++ svn_1.1_releasenotes.html (working copy)
@@ -16,10 +16,8 @@
 <body>
 <div class="app">
 
-<div align="center">
-<h1>Subversion 1.1 Release Notes</h1>
-<h2>(and State of the Project)</h2>
-</div>
+<h1 style="text-align: center">Subversion 1.1 Release Notes</h1>
+<h2 style="text-align: center">(and State of the Project)</h2>
 
 <p>The Subversion book site
 has now been forked, and a separate <a
Index: svn_1.2_releasenotes.html
===================================================================
--- svn_1.2_releasenotes.html (revision 14100)
+++ svn_1.2_releasenotes.html (working copy)
@@ -16,7 +16,7 @@
 <body>
 <div class="app">
 
-<h1 align="center">Subversion 1.2 Release Notes</h1>
+<h1 style="text-align: center">Subversion 1.2 Release Notes</h1>
 
 <p>These new features will ultimately be documented in a 1.2 version
 of the free Subversion book; check the <a
Index: index.html
===================================================================
--- index.html (revision 14100)
+++ index.html (working copy)
@@ -50,8 +50,8 @@
 href="/project_license.html">Apache/BSD-style</a> open source license.
 </p>
 
-<p align="center">
-<img src="/subversion_logo_hor-468x64.png" alt="Subversion"
+<p style="text-align: center">
+<img src="subversion_logo_hor-468x64.png" alt="Subversion"
      width="468" height="64"/>
 </p>
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Apr 11 13:27:32 2005

This is an archived mail posted to the Subversion Dev mailing list.