Java 的 CSS 解析器 jStyleParser

码农软件 · 软件分类 · 常用工具包 · 2019-08-13 08:11:53

软件介绍

jStyleParser 是一个开源 Java 的 CSS 解析器,可以在 Java 程序中解析 CSS 样式文件。

Maven

<dependency>
    <groupId>net.sf.cssbox</groupId>
    <artifactId>jstyleparser</artifactId>
    <version>3.2</version>
</dependency>

示例代码:

//get the element style
StyleMap map = CSSFactory.assignDOM(doc, encoding, base, medium, true);
NodeData style = map.get(element);
//get the type of the assigned value
CSSProperty.Margin mm = style.getProperty("margin-top");
System.out.println("margin-top=" + mm);
//if a length is specified, obtain the exact value
if (mm == Margin.length)
{
    TermLength mtop = style.getValue(TermLength.class, "margin-top");
    System.out.println("value=" + mtop);
}

本文地址:https://codercto.com/soft/d/12253.html

More Eric Meyer on CSS (Voices That Matter)

More Eric Meyer on CSS (Voices That Matter)

Eric A. Meyer / New Riders Press / 2004-04-08 / USD 45.00

Ready to commit to using more CSS on your sites? If you are a hands-on learner who has been toying with CSS and want to experiment with real-world projects that will enable you to see how CSS......一起来看看 《More Eric Meyer on CSS (Voices That Matter)》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

URL 编码/解码
URL 编码/解码

URL 编码/解码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具