Loading...

phax/ph-cssを使う

2016/10/09 10:43
2024/12/30 17:55
phax/ph-css の使い方
// parsing css and get CSSOM
final CascadingStyleSheet css = CSSReader.readFromString(
                ".index h1,
" +
                ".index h2,
" +
                ".index h3,
" +
                ".index h4,
" +
                ".index h5,
" +
                ".index h6 {
" +
                "    font-family: \"ヒラギノ明朝 ProN W3\", \"HiraMinProN-W3\", serif;
" +
                "    font-size: large;
" +
                "}", ECSSVersion.CSS30);

// writing css
final String writtenCss = new CSSWriter(ECSSVersion.CSS30).getCSSAsString(css);
<img src="http://53ningen.com/wp-content/uploads/2016/10/b080e264-d67f-11e4-845e-c1f3fdff6678.png" b080e264-d67f-11e4-845e-c1f3fdff6678" width="828" height="490" class="aligncenter size-full wp-image-670" />
便利