Xslt:如何在xslt样式表中按类选择器选择xml元素?(Xslt: how to select xml elements by class selector in a xslt styleshee

编程入门 行业动态 更新时间:2024-10-28 19:32:04
Xslt:如何在xslt样式表中按类选择器选择xml元素?(Xslt: how to select xml elements by class selector in a xslt stylesheet?)

我的HTML代码(进入xslt文件)

<p class=".hello">hello</p>

为什么css类选择器不能在我的CSS中工作? (此css文件由xslt样式表调用)。

我的css代码

.hello{ color: red; /*not working */ } p{ color: red; /* working */ }

My html code (which is into an xslt file)

<p class=".hello">hello</p>

Why css class-selector is not working in my css ? (this css file is called by a xslt stylesheet).

My css code

.hello{ color: red; /*not working */ } p{ color: red; /* working */ }

最满意答案

使用此行

<p class="hello">hello</p>

设置一个可访问的类

.hello { ... }

并在此行设置ID:

<p id="hello">hello</p>

可以通过

#hello { ... }

总结: class属性值中的一个点太多了。

Use this line

<p class="hello">hello</p>

to set a class accessible by

.hello { ... }

And this line to set an ID:

<p id="hello">hello</p>

accessible by

#hello { ... }

Summary: one dot too much in your class attribute value.

更多推荐

css,xslt,hello,文件,working,电脑培训,计算机培训,IT培训"/> <meta name="des

本文发布于:2023-08-05 23:13:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1440271.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:样式表   元素   选择器   如何在   Xslt

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!