Hi G. Wade,

You should come to the SVG Open 2006 and give a talk about CSS best
practices.  Also, maybe a short tutorial about using CSS with SVG. 
Teach all these naysayers a leson, so to speak. :)

Cheers,
Alastair

--- In svg-developers@yahoogroups.com, "G. Wade Johnson" <[EMAIL PROTECTED]>
wrote:
>
> The CSS styles override the equivalent attributes.
> 
> That's why I normally use CSS for the styles that won't change and
attributes
> for the styles I plan to modify. This works quite well if you have
only one or
> two attributes to change. For example,
> 
> <style>
>   .box { fill: blue; stroke-width: 1px; }
> </style>
> 
> <rect class="box" stroke="0x00f"
>       x="10" y="10" width="100" height="50"/>
> 
> Now you can change the stroke color easily with script.
> 
> If the number of attributes you need to change is large and/or the
number of
> possibilities is small, CSS classes work well.
> 
> <style>
>   .bar     { stroke-width: 1; stroke:#00f; fill:#66f; }
>   .alarmed { stroke-width: 0; stroke:none; fill:red; }
> </style>
> 
> 
> <rect class="bar"
>       x="10" y="10" width="100" height="50"/>
> 
> Now by changing the class, you can change multiple attributes at once.
> 
> G. Wade
> 
> On Mon, 31 Oct 2005 20:48:12 -0000
> "sent1729" <[EMAIL PROTECTED]> wrote:
> 
> > Hi all,
> > 
> >              I have rectangles in my svg document, and i have defined 
> > the style of the rectangle in a seperate style sheet(.css). I
wanted to 
> > change the stroke color of the rectangle programatically. I tried 
> > assigning the stroke property as:
> > 
> > rect= document.getElementById("Element ID");
> > rect.setAttribute("stroke",'color'). But it always stays the same
color 
> > as defined in the style sheet. Is there a way to alter the attributes 
> > as stroke, fill etc., which are pre-defined in a seperate style sheet.
> > 
> > Any input is greatly appreciated,
> > 
> > Thanks
> > Nathan.
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > -----
> > To unsubscribe send a message to:
[EMAIL PROTECTED]
> > -or-
> > visit http://groups.yahoo.com/group/svg-developers and click "edit my
> > membership"---- 
> > Yahoo! Groups Links
> > 
> > 
> > 
> >  
> > 
> 
> 
> -- 
> $HOME is where your dotfiles are.                       -- Gym Quirk
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/1U_rlB/TM
--------------------------------------------------------------------~-> 

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to