At 11:59 AM -0400 4/26/09, Robert Cummings wrote:
On Sun, 2009-04-26 at 11:40 -0400, tedd wrote:

 > While it might not fit with the purest css, it works for me. YMMV.  :-)

Your thinking is flawed. Yes you could have a class called center and it
does exactly that... center the text. However to make the text left
aligned you now need to edit the HTML to assign the class left intead of
center. The whole point of CSS is to not edit the HTML to make stylistic
changes. It maybe be obvious that having classes center and red makes
the content centered and coloured red, but that is no different than
having an align attribute and a color attribute which is EXACTLY what
CSS is supposed to replace.



I truly see your point and I don't disagree with it.

However, there are times where the client says "I want this centered" and center it you must without giving that section of text an attribute name.

Sure I could say "I know the client wants this selection-of-text centered and he isn't willing (or agree) to give this selection-of-text a name, so I'll do it. I'll call it this 'selection-of-text' "selection-of-text". That way years from now when the client says "I no longer want that selection-of-text centered but right justified" I can change a single rule in the "selection-of-text" class attribute and the critter will be done without me altering a single line of html. Sure, that sounds good..

But experience has shown me that when that happens, the client usually doesn't single out that specific "selection-of-text" the same way again but rather picks something even more convoluted thereby defeating the entire process.

I realize that the entire idea here is to remove any need to alter the html to make styling changes, but clients usually negate that concept for when they want to change things, it's not just styling they want to change, but everything.

Also try explaining style sheets to a client and why they should think in terms of elements, blocks of text, maintenance, separating style from presentation, and all that other noble stuff, when all they what is to make something bold, centered, red, or all three.

For example, I have one client who's entire web site shows the same explanation-link on each page the exact same way and then he said "Oh, on page 43, let's change that from blue and bold to red and right justified." As such, I had to write page specific code to make that single change for that specific page plus writing a new css rule. Using css the correct way would have never saved me from the additional html work.

Sometimes simple is not only simpler, but easier to understand and faster to implement -- especially when you are dealing with clients who have absolutely no understanding of the proper ways of doing things. They just want their eclectic stuff shown they way they think, which is usually anything but organized.



PHP General Mailing List (
To unsubscribe, visit:

Reply via email to