CSS present in DOM but not applied

Discussion in 'HTML' started by Flintstone, Jan 18, 2008.

  1. Flintstone

    Flintstone Guest

    There are 3 or 4 places I could have posted this but I think this
    group is the most likely to come up with a solution.

    I have a web app written in ASP.NET with an external stylesheet which
    is actually an aspx file. Normally the page loads fine and all styles
    are applied correctly but I have discovered a weird IE only problem.

    1) Copy some text from the web page
    2) Paste the text into Word
    3) Close the web page and open it again.

    Magically all my CSS styles vanish. The strangest thing is that if I
    look at the DOM in IEs Web Developer Toolbar all of the colors, styles
    etc from the stylesheet are present but for some reason they are not
    applied.

    I have tried setting the stylesheet to disabled
    (document.styleSheet[0].disabled=true) and then enabling it again but
    that seems to make no difference.

    Pressing F5 fixes the page but I really need a more permanent fix.

    Does anybody have and idea why this happens or what I could do about
    it?
    Flintstone, Jan 18, 2008
    #1
    1. Advertising

  2. Gazing into my crystal ball I observed Flintstone
    <> writing in news:e59769be-c20c-4f35-b79d-
    :

    > There are 3 or 4 places I could have posted this but I think this
    > group is the most likely to come up with a solution.
    >
    > I have a web app written in ASP.NET with an external stylesheet which
    > is actually an aspx file. Normally the page loads fine and all styles
    > are applied correctly but I have discovered a weird IE only problem.
    >
    > 1) Copy some text from the web page
    > 2) Paste the text into Word
    > 3) Close the web page and open it again.
    >
    > Magically all my CSS styles vanish. The strangest thing is that if I
    > look at the DOM in IEs Web Developer Toolbar all of the colors, styles
    > etc from the stylesheet are present but for some reason they are not
    > applied.
    >
    > I have tried setting the stylesheet to disabled
    > (document.styleSheet[0].disabled=true) and then enabling it again but
    > that seems to make no difference.
    >
    > Pressing F5 fixes the page but I really need a more permanent fix.
    >
    > Does anybody have and idea why this happens or what I could do about
    > it?
    >


    URL? Does this only happen in IE? Does this only happen on your
    system, and what OS?

    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne Boswell, Jan 18, 2008
    #2
    1. Advertising

  3. Flintstone

    Flintstone Guest

    This is a web app so I cannot give you a URL, it is an IE only
    problem, it happens on all systems, all IE versions and on all Windows
    versions.
    Flintstone, Jan 18, 2008
    #3
  4. Flintstone

    Neredbojias Guest

    Well bust mah britches and call me cheeky, on Fri, 18 Jan 2008 15:09:45 GMT
    Flintstone scribed:

    > There are 3 or 4 places I could have posted this but I think this
    > group is the most likely to come up with a solution.
    >
    > I have a web app written in ASP.NET with an external stylesheet which
    > is actually an aspx file. Normally the page loads fine and all styles
    > are applied correctly but I have discovered a weird IE only problem.
    >
    > 1) Copy some text from the web page
    > 2) Paste the text into Word
    > 3) Close the web page and open it again.
    >
    > Magically all my CSS styles vanish. The strangest thing is that if I
    > look at the DOM in IEs Web Developer Toolbar all of the colors, styles
    > etc from the stylesheet are present but for some reason they are not
    > applied.
    >
    > I have tried setting the stylesheet to disabled
    > (document.styleSheet[0].disabled=true) and then enabling it again but
    > that seems to make no difference.
    >
    > Pressing F5 fixes the page but I really need a more permanent fix.
    >
    > Does anybody have and idea why this happens or what I could do about
    > it?


    Interesting screw-up. Are you using xhtml or html? I suspect it is just
    another one of the myriad IE faults but you could try playing with the
    cache to see if it makes any difference.

    --
    Neredbojias
    Riches are their own reward.
    Neredbojias, Jan 18, 2008
    #4
  5. You might start here http://msdn2.microsoft.com/en-us/ie/default.aspx
    --
    ~Robear Dyer (PA Bear)
    MS MVP-Windows (IE, OE, Security, Shell/User)
    AumHa VSOP & Admin http://aumha.net
    DTS-L http://dts-l.net/

    Flintstone wrote:
    > There are 3 or 4 places I could have posted this but I think this
    > group is the most likely to come up with a solution.
    >
    > I have a web app written in ASP.NET with an external stylesheet which
    > is actually an aspx file. Normally the page loads fine and all styles
    > are applied correctly but I have discovered a weird IE only problem.
    >
    > 1) Copy some text from the web page
    > 2) Paste the text into Word
    > 3) Close the web page and open it again.
    >
    > Magically all my CSS styles vanish. The strangest thing is that if I
    > look at the DOM in IEs Web Developer Toolbar all of the colors, styles
    > etc from the stylesheet are present but for some reason they are not
    > applied.
    >
    > I have tried setting the stylesheet to disabled
    > (document.styleSheet[0].disabled=true) and then enabling it again but
    > that seems to make no difference.
    >
    > Pressing F5 fixes the page but I really need a more permanent fix.
    >
    > Does anybody have and idea why this happens or what I could do about
    > it?
    PA Bear [MS MVP], Jan 18, 2008
    #5
  6. Flintstone

    Flintstone Guest

    Yes, clearing the cache does fix it until the next time. I suppose it
    reloads the page and the reload forces it to re-render the HTML
    elements. I suspect there is some kind of internal cacheing going on
    apart from the normal internet cache.

    Pa Bear, excellent idea ... I will post on the MS IE Dev forums.

    Thanks
    Flintstone, Jan 18, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ian Gordon

    css not applied + lost image

    Ian Gordon, Aug 7, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    1,693
    Yan-Hong Huang[MSFT]
    Aug 11, 2003
  2. Ralf Wahner
    Replies:
    5
    Views:
    627
    Bob Foster
    Dec 24, 2003
  3. R.A.M.
    Replies:
    4
    Views:
    962
    R.A.M.
    Oct 12, 2007
  4. Dave

    CSS not being applied

    Dave, Jan 14, 2008, in forum: HTML
    Replies:
    5
    Views:
    937
    GTalbot
    Jan 14, 2008
  5. Cramer
    Replies:
    1
    Views:
    265
Loading...

Share This Page