如题

解决方案 »

  1.   

    一个Html文件中不是有<Head></Head>块吗,我想把它保存下来,希望解析其中的Style等等模块。
      

  2.   

    IHTMLHeadElement(IE6 or higher)
    or compare the tagName property of IHTMLElement with "head"
    Infact, styles are not necessarily in <HEAD>.You can retrieve a pointer to the style sheet object using the IHTMLDocument2::styleSheets method. You can also retrieve a collection of all IHTMLStyleSheetsCollection in the document using the IHTMLStyleSheet::imports method. Each item in the collection is a style sheet. A style sheet object is available for a style sheet only if it is included in a document with a style or link element, or with an @import statement in the style element. to determin the style of an element, use
    HRESULT IHTMLElement::get_style(IHTMLStyle** p); method