So I have a <g> element with some <rect>s inside it, they all have same fill color, but can be of different sizes. I want to reuse the <g>, but fill it with a different color, is it possible?
I can change the markup any way I like.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can define the rect group using
<defs>like so:Then you can use this group multiple times, putting it in different places with with
transformif you like:You can style these groups directly or give them different classes as above and use CSS to style as you like:
For an example, see: http://dl.dropbox.com/u/169269/rect_group.svg