Re: Change color of anything in double/single quotes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2009-04-26 at 11:40 -0400, tedd wrote:
> At 9:47 AM -0400 4/26/09, Robert Cummings wrote:
> >On Sun, 2009-04-26 at 14:49 +0100, Ashley Sheridan wrote:
> >  > On Sun, 2009-04-26 at 09:41 -0400, tedd wrote:
> >  > > <span class="red"><?php echo('hello'); ?></span><?php echo(' there'); ?>
> >  > >
> >  > I'd go further on that and say don't call your class 'red', as it
> >  > doesn't do anything for semantic code, but that's just me trolling ;)
> >
> >I was about to say the same thing *lol*. tis true though, the class
> >should be "doubleQuoted" or something similar. What happens when they
> >decide it should be blue?
> >
> >span.red
> >{
> >     color: blue;
> >}
> >
> >Uh huh, uh huh, uh huh :)
> 
> 
> I fully understand, but I also see two side to this.
> 
> On one side, I agree that one should always keep attributes vague 
> enough so they can be anything, such as class="warning" and that way 
> the client may say "I don't want it red now, but orange" and it will 
> be easy enough to change.
> 
> On the other side, some attributes may be exactly what they claim, 
> such as class="center" or class="red". There is little confusion 
> about what those classes mean as compared to more vague terms. As 
> such, exact attributes are indeed semantic.
> 
> So as I see it, with *some* attributes it's a toss-up  -- you can add 
> a layer of abstraction by making them vague  OR you can use a more 
> exact (semantic) meaning. I don't find much fault with either way 
> provided that it's not a big problem later. The dividing line here is 
> one of how much work it causes.
> 
> Additional consideration, one can combine exact attributes, such as 
> class="center red" and it both works and is obvious.
> 
> I often have in my css, rules such as:
> 
> .center
>     {
>     text-align: center;
>     }
> 
> .red
>     {
>     color: red;
>      }
> 
> 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.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux