Some properties in stylesheet/inline stlye form don't work?

Discuss SVG code, accessible via the XML Editor.
Vectorator
Posts: 96
Joined: Tue Oct 21, 2014 1:40 pm
Location: Australia

Some properties in stylesheet/inline stlye form don't work?

Postby Vectorator » Mon Mar 09, 2015 10:39 pm

I am learning how to write svg graphics in notepad but I have reached a problem that doesn't seem to make any sense and I can't get past.

If I have a rect and write a property of height="75" it works but if I write style="height:75;" instead it doesn't work (ie. the rect disappears, most likely because it has no height).

But if I write fill="red" it works and if I write style="fill:red;" it also works

Do some properties have different names when used in a stylesheet or inline styles as opposed to directly in the svg code?


<rect class="rect1" x="50" y="100" width="400" height="75" fill="red" /> - Works
<rect class="rect1" x="50" y="100" width="400" style="height:75;" fill="red" /> - Doesn't work (no rectangle displaying)


Some things seem to work in both stylesheets/inline styles and directly written in svg and others don't.
For further examples: stroke and stroke-width work in both but preserveAspectRatio doesn't work in style form.

hulf2012
Posts: 716
Joined: Sat Nov 24, 2012 12:37 pm

Re: Some properties in stylesheet/inline stlye form don't wo

Postby hulf2012 » Thu Mar 12, 2015 12:39 pm

Hello
Related information:
http://tutorials.jenkov.com/svg/svg-and-css.html

Greetings
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.

Vectorator
Posts: 96
Joined: Tue Oct 21, 2014 1:40 pm
Location: Australia

Re: Some properties in stylesheet/inline stlye form don't wo

Postby Vectorator » Thu Mar 12, 2015 3:34 pm

Ok thanks, that is a much more in depth tutorial.

I have already found a solution to another issue in chapter six.

I had read another tutorial which didn't cover many of these things.


Return to “SVG / XML Code”