/// <summary> /// Adds to body. /// </summary> /// <param name="element">The element.</param> /// <returns></returns> public HtmlBuilder AddToBody(HtmlElement element) { Root.Body.AddChild(element); return(this); }
/// <summary> /// Initializes a new instance of the <see cref="HtmlBuilder"/> class. /// </summary> /// <param name="head">The head.</param> /// <param name="body">The body.</param> public HtmlBuilder(HtmlElement head, HtmlElement body) { Root = new HtmlRoot(head, body); }
/// <summary> /// Adds to head. /// </summary> /// <param name="element">The element.</param> /// <returns></returns> public HtmlBuilder AddToHead(HtmlElement element) { Root.Head.AddChild(element); return(this); }
/// <summary> /// Builds this instance. /// </summary> /// <returns></returns> public string Build() { var html = new HtmlElement(HtmlTag.Html, Head.Build() + Body.Build(), _attributes); return(html.Build()); }