Can you style XHTML elements in another namespace using id and class name css selectors?

前端 未结 3 1879
深忆病人
深忆病人 2020-12-18 06:22

I\'m developing an application that uses ubiquity-xforms. Previously I had been serving the pages up as text/html with the XHTML 1.0 doctype.

If I switched the mime-

3条回答
  •  时光取名叫无心
    2020-12-18 07:07

    You don't have to use #id/.class selectors. Instead you can use:

    [id=test] {}
    [class|=testing] {}
    

    which are equivalent.

    AFAIK class is HTML-specific thing, and because XML namespaces are completely insane, XHTML attributes aren't in the XHTML namespace! You're probably out of luck with this one.

    For ID you might try xml:id, but I haven't checked if anything actually supports it.

    In case you wanted to match namespaced elements, that's possible with CSS Namespaces:

    @namespace xf "http://www.w3.org/2002/xforms";
    xf|group {}
    

提交回复
热议问题