Inkscape.org
Beyond the Basics style attribute disappears at random times
  1. #1
    barna barna @barna

    Hi,

    I have created a wiring/connection diagram for a device, with interactivity (toggle visibility of different wires to ease navigation and understanding of the crowded diagram). In order to indicate clickable items, I have set style='cursor: pointer;' attributes in the XML editor for the clickable/interactive items. 

    The problem is that the style attribute regularly disappears at random times. First I believed this is due to the object being moved,but later it did occur also when I did not touch the given object at all, only worked on other objects. 

    Is there any chance to set and keep this attribute? It is extremely annoying, a lot of time went now in vain. 

    Thank you

  2. #2
    inklinea inklinea @inklinea⛰️

    Perhaps like this:

     

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!-- Created with Inkscape (http://www.inkscape.org/) -->

    <svg
       width="210mm"
       height="297mm"
       viewBox="0 0 210 297"
       version="1.1"
       id="svg1"
       inkscape:version="1.4 (1:1.4+202410161351+e7c3feb100)"
       sodipodi:docname="cursor_test.svg"
       xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
       xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:svg="http://www.w3.org/2000/svg">
      <sodipodi:namedview
         id="namedview1"
         pagecolor="#ffffff"
         bordercolor="#000000"
         borderopacity="0.25"
         inkscape:showpageshadow="2"
         inkscape:pageopacity="0.0"
         inkscape:pagecheckerboard="0"
         inkscape:deskcolor="#d1d1d1"
         inkscape:document-units="mm"
         inkscape:zoom="0.72782688"
         inkscape:cx="396.38547"
         inkscape:cy="561.25984"
         inkscape:window-width="1920"
         inkscape:window-height="1022"
         inkscape:window-x="0"
         inkscape:window-y="0"
         inkscape:window-maximized="1"
         inkscape:current-layer="layer1" />
      <defs
         id="defs1" />
      <style
         id="cursor_style"
         type="text/css"><![CDATA[
          .crosshair_class {
            cursor: crosshair;
          }
        ]]></style>
      <g
         inkscape:label="Layer 1"
         inkscape:groupmode="layer"
         id="layer1">
        <rect
           class="crosshair_class"
           style="fill:#00ff00;stroke:#ff0000;stroke-width:1"
           id="rect1"
           width="92.698898"
           height="16.358629"
           x="60.345165"
           y="89.063644" />
      </g>
    </svg>

Inkscape Inkscape.org Inkscape Forum Beyond the Basics style attribute disappears at random times