Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Front-end Development using CSharp

Front-end Development using CSharp

Front-end Development using CSharp
http://young.blog.jp.klab.com/archives/37630043.html

Mayuki Sawatari

March 25, 2014
Tweet

More Decks by Mayuki Sawatari

Other Decks in Programming

Transcript

  1. ( )

  2. var content = @ <ul> <li><a href=""#"">1</a></li> <li><a href=""#"">2</a></li> </ul>";

    var htmlFilter = new HtmlFilter(); htmlFilter.AddHandler("li:nth-child(2n)", (ctx, nodeInfo) => { nodeInfo.Attributes["style"] = "color:red;"; return true; });
  3. var content = @ <ul> <li><a href=""#"">1</a></li> <li><a href=""#"">2</a></li> </ul>";

    var htmlFilter = new HtmlFilter(); htmlFilter.AddHandler("li:nth-child(2n)", (ctx, nodeInfo) => { nodeInfo.Attributes["style"] = "color:red;"; return true; }); var sw = new StringWriter(); htmlFilter.Execute(new CarteletContext(content, sw), HtmlParser.Parse(content)); sw.ToString(); // <ul> // <li><a href="#">1</a></li> // <li style="color:red;"><a href="#">2</a></li> // </ul>
  4. background-color #000 display block content '' vertical-align top background-image urlhelper('/common/block_06-03.gif')

    height 17px width 240px margin $margin-block-topbottom 0 vertical-align top vertical-align bottom
  5. C#