Maroontress.HtmlBuilder Example-1 Elements

CSharp · Console

/Program.cs

// https://maroontress.github.io/HtmlBuilder/
using System;
using Maroontress.Html;
					
public sealed class Program
{
	public static void Main()
	{
		var nodeOf = Nodes.NewFactory();
		var html = nodeOf.Html.Add(
			nodeOf.Head.Add(
				nodeOf.Title.Add("My first web page")),
			nodeOf.Body.Add(
				nodeOf.P.Add("Hello, World!")));
		var result = html.ToString();

		Console.WriteLine(result);
	}
}
;