1. A computer-implemented method for rendering a web page image, the method comprising: receiving by one or more processors a Hypertext Markup Language (HTML) document having an element thereon, the HTML document including information associating the element with an external component that is encapsulated and external to the HTML document, the information comprising a reference to an extensible markup language (XML) namespace maintained in a cascading style sheet, the XML namespace declaring at least one behavior that can be imparted on elements in HTML documents, wherein a script for the at least one behavior is maintained in the external component separate from the HTML document, and wherein each of the at least one behavior includes an interface to the script maintained in the external component that can be called from the HTML document; rendering by the one or more processors a page image corresponding to at least part of the HTML document, the page image including a representation of the element; calling an interface of the external component to execute the script within the external component to impart one of the at least one behavior on the element rendered on the page image to enhance the element; attaching the behavior to the element; and wherein the behavior is attached to the element through the cascading style sheet, using a style rule defined in the HTML document.