【发布时间】:2015-04-27 23:59:08
【问题描述】:
我正在尝试从 SVG 中选择所有遵循某种模式的元素来更改这些元素的光标:
这是一个代码示例:
<g id="group418-1085" transform="translate(1975.93,-1403.11)" v:mID="418" v:groupContext="group">
<v:custProps>
<v:cp v:nameU="idApplication" v:lbl="idApplication" v:type="0" v:sortKey="1" v:langID="1036" v:val="VT4(216)"/>
<v:cp v:nameU="labelFR" v:lbl="labelFR" v:type="0" v:sortKey="3" v:langID="1036"
v:val="VT4(Product Ref)"/>
<v:cp v:nameU="labelEN" v:lbl="labelEN" v:type="0" v:sortKey="4" v:langID="1036"
v:val="VT4(Product entity)"/>
<v:cp v:nameU="color" v:lbl="color" v:type="0" v:sortKey="99" v:langID="1036" v:val="VT4()"/>
<v:cp v:nameU="type" v:lbl="type" v:type="0" v:sortKey="5" v:langID="1036" v:val="VT4(Business)"/>
<v:cp v:nameU="name" v:lbl="name" v:type="0" v:sortKey="2" v:langID="1036" v:val="VT4(FundLife)"/>
<v:cp v:nameU="External" v:lbl="External" v:type="0" v:langID="1036" v:val="VT4(FALSE)"/>
<v:cp v:nameU="appLevel" v:lbl="appLevel" v:type="0" v:langID="1036" v:val="VT4(2)"/>
<v:cp v:nameU="_VisDM_status" v:lbl="status" v:type="2" v:langID="1036" v:val="VT0(1):26"/>
</v:custProps>
<v:userDefs>
<v:ud v:nameU="msvStructureType" v:prompt="" v:val="VT4(Container)"/>
<v:ud v:nameU="msvSDContainerMargin" v:prompt="" v:val="VT0(0.078740157480315):24"/>
<v:ud v:nameU="Label" v:prompt="" v:val="VT0(2):26"/>
<v:ud v:nameU="ShapeVersion" v:prompt="" v:val="VT0(1):26"/>
<v:ud v:nameU="LightColorText" v:prompt="" v:val="VT0(0):5"/>
<v:ud v:nameU="TechnicalVue" v:prompt="" v:val="VT0(0):5"/>
<v:ud v:nameU="MainColor" v:prompt="" v:val="VT4(RGB(213;213;213))"/>
</v:userDefs>
<title>Application.51</title>
<g id="shape419-1086" v:mID="419" v:groupContext="shape">
<title>Feuille.419</title>
<v:userDefs>
<v:ud v:nameU="visVersion" v:val="VT0(14):26"/>
</v:userDefs>
<rect x="0" y="1641.26" width="113.386" height="42.5197" class="st56"/>
</g>
<g id="shape418-1088" v:mID="418" v:groupContext="groupContent">
<v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/>
<v:textRect cx="56.6929" cy="1662.52" width="113.39" height="42.5197"/>
<text x="44.24" y="1652.02" class="st4" v:langID="1036"><v:paragraph v:horizAlign="1"/><v:tabList/>FundLife<v:newlineChar/><v:newlineChar/><tspan
x="6.06" dy="2.4em" class="st55">Product referential for all entities of </tspan><tspan x="36.1"
dy="1.2em" class="st55">Owner</tspan></text> </g>
</g>
所以我要选择的是rect。
我要选择的rect始终是g 的子代,g 的子代具有v:nameU 属性和值为idApplication 的后代。
(这个后代始终是v:custoProps 的g 的子代的v:cp 子代,就像上面的代码一样,但我认为没有必要使用它。)
所以我在想:
g v:cp[v:nameU="idApplication"] > g > rect {cursor: help;}
但这不起作用。
【问题讨论】:
-
据我所知(在您的代码中),
idApplication永远不会有g子级 -
你的意思是
v:cp[v:nameU="idApplication"] > g在g v:cp[v:nameU="idApplication"]之前计算如果是这样我如何将优先级设置为g v:cp[v:nameU="idApplication"]选择器?
标签: html css svg css-selectors