示例#1
0
        static void Main()
        {
            Element html =
                new Element("html",
                    new Element("head"),
                    new Element("body",
                        new Element("section",
                            new Element("h2"),
                            new Element("p"),
                            new Element("span")),
                        new Element("footer")));

            File.WriteAllText("index.html", html.Display());
        }
示例#2
0
        public static void Main()
        {
            Element html = 
                new Element("html",
                    new Element("head"),
                    new Element("body", 
                        new Element("section", 
                            new Element("h2"),
                            new Element("p"),
                            new Element("span")),
                        new Element("footer")));

            html.Display();

            // Console.WriteLine(html);
        }
        public static void Main()
        {
            Element html = new Element("html",
                            new Element("head"),
                            new Element("body",
                                new Element("section",
                                    new Element("h3"),
                                    new Element("p")),
                                new Element("ul",
                                    new Element("li",
                                        new Element("a")),
                                    new Element("li",
                                        new Element("a"))),
                                new Element("footer")));
            html.Add(new Element("script"));

            Console.WriteLine(html.Display());
        }
示例#4
0
 public void Remove(Element element)
 {
     this.Elements.Remove(element);
 }
示例#5
0
 public void Add(Element element)
 {
     this.Elements.Add(element);
 }