1. A system for rendering a web page comprising: one or more computer processors; one or more computer readable storage media; and program instructions stored on the one or more computer readable storage media for execution by at least one of the one or more processors to perform actions of: parsing a Hypertext Markup Language (HTML) document for a web page, wherein the HTML document includes elements of the web page; parsing a style sheet corresponding to the HTML document, wherein the style sheet includes a set of attributes that define the styles of each of the elements; generating a Document Object Model (DOM) tree, wherein: the structure of the DOM tree is organized based on the set of attributes, wherein each of the attributes in the set of attributes corresponds to a branch of the DOM tree; and the DOM tree includes hidden elements and non-hidden elements, wherein: the structure of the DOM tree is further organized such that the hidden elements and the non-hidden elements are assigned to separate branches; and the non-hidden elements are organized based on their z-index attributes from the style sheet corresponding to the HTML document; rendering the non-hidden elements in the DOM tree in a higher-to-lower sequence based on their z-index attributes, wherein rendering the non-hidden elements is based, at least in part, on: identifying a first position of a first non-hidden element; identifying a second position and an opacity value of a second non-hidden element, wherein the second non-hidden element has a higher z-index attribute than the first non-hidden element; determining, based on the first position and the second position, that the first non-hidden element is encompassed by the second non-hidden element; and determining that the second non-hidden element has an opacity value such that the first non-hidden element is viewable on the web page.