Re: Change color of anything in double/single quotes

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

 



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.  :-)

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
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