|  | Posted by Jonathan N. Little on 03/12/07 14:33 
Richard Formby wrote:> Toby A Inkster
 >
 > [for & against inline styles]
 >
 >> Adrienne Boswell wrote:
 >>
 >>> It depends on the circumstance.  For example, say I have DT styled as
 >>> bold in the external sheet, but on one page on the site, I want it
 >>> italics instead - in that case, I would use put the style in the head on
 >>> that page only.
 >> Some might argue that a better approach would be to add a class to your
 >> BODY element such as:
 >>
 >> <BODY CLASS="special_definition_lists">
 >> ...
 >> </BODY>
 >>
 >> and then add your styling to the main style sheet. One page with special
 >> definition lists tends to lead to two such pages, or three, or...
 >>
 >> Personally, I'd consider both methods on a case-by-case method. Each has
 >> advantages and disadvantages.
 >
 > Further...
 >
 > I have a single, say, contact form in my entire web site. I want to apply a
 > certain style to that single form.
 >
 > <form style="whatever"> works for me.
 >
 > "Whatever" is never ever used anywhere else.
 >
 > "Whatever"  is in the form elements opening tag. If I want to change it I go
 > directly to the page containing the form and change it right there. I don't
 > have to scroll up to the top of the HTML document. I don't have to find it
 > in my 'global' style sheet. It's right there. In the only form in my entire
 > site that it applies to.
 >
 > But, as you say, case by case.
 >
 > I tend to think in C++ or C# terms. Is this variable [style property/value]
 > global to the entire application, local to this particular [C#] class, local
 > to a member function within that [C#] class or is it indeed local to a
 > specific block of code within that function.
 >
 > Hint: the i in for (int i =  ...)  or in Javascript  for (var i  = ...)
 > should always be local.
 >
 
 I have a tendency to do the same, in HEAD put page specific styles. One
 note though is when your make a dramatic site-wide style change these
 little on-page exceptions may bite you in the end!
 
 --
 Take care,
 
 Jonathan
 -------------------
 LITTLE WORKS STUDIO
 http://www.LittleWorksStudio.com
 [Back to original message] |