Turning Off CSS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ctiggerf

    Turning Off CSS

    Is there a simple way to quickly turn off all css styles for a section
    of a page.

    For example I am writting an email app and I want to be able to
    preview what I've entered so I can see what it the email will
    tentativly look like b4 I send it out to 200 people.

    I have the preview there in a cell on the page but it takes the
    properties in the stylesheet ... the stylesheet won't be there in the
    email so what they are seeing may or may not be what it will look like.

    There's got to be a simple way to turn off the styles for just one cell
    in a table or a div or something. I know you guys will know the
    answer.

    Thanks in advance,
    Chris

  • Jukka K. Korpela

    #2
    Re: Turning Off CSS

    "ctiggerf" <ctiggerf@gmail .com> wrote:
    [color=blue]
    > Is there a simple way to quickly turn off all css styles for a section
    > of a page.[/color]

    There is none.
    [color=blue]
    > For example I am writting an email app and I want to be able to
    > preview what I've entered so I can see what it the email will
    > tentativly look like b4 I send it out to 200 people.[/color]

    How does this relate to using CSS in authoring for the WWW?
    [color=blue]
    > I have the preview there in a cell on the page but it takes the
    > properties in the stylesheet ... the stylesheet won't be there in the
    > email so what they are seeing may or may not be what it will look like.[/color]

    Presumably you are using a web browser somehow for the purpose of composing
    an E-mail message, using some software that you don't even describe, still
    less illustrate with a URL. Are we supposed to guess what you are really
    trying to accomplish and in which environment?
    [color=blue]
    > There's got to be a simple way to turn off the styles for just one cell
    > in a table or a div or something. I know you guys will know the
    > answer.[/color]

    We know there isn't, but we don't know what your real question is.

    Depending on exactly how you construct the E-mail message, you might be able
    to display it in an <iframe> element in a table cell, or whatever. Then it
    would not be part of the page but rendered as an independent document.

    P.S. You are apparently sending HTML or XML E-mail (otherwise you would not
    worry about CSS). Most probably, you haven't considered the implications
    (such as having your E-mail treated as spam).

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/

    Comment

    • Gus Richter

      #3
      Re: Turning Off CSS

      ctiggerf wrote:[color=blue]
      > Is there a simple way to quickly turn off all css styles for a section
      > of a page.
      >
      > For example I am writting an email app and I want to be able to
      > preview what I've entered so I can see what it the email will
      > tentativly look like b4 I send it out to 200 people.
      >
      > I have the preview there in a cell on the page but it takes the
      > properties in the stylesheet ... the stylesheet won't be there in the
      > email so what they are seeing may or may not be what it will look like.
      >
      > There's got to be a simple way to turn off the styles for just one cell
      > in a table or a div or something. I know you guys will know the
      > answer.
      >
      > Thanks in advance,
      > Chris
      >[/color]

      You apparently are using a Mozilla product to create your mail, although
      I'm not familiar with the gzip potion in your UA string. You mention that:
      "the stylesheet won't be there in the email ..."
      I don't know why you say that. It may be that you are using Mozilla
      (Thunderbird, or whatever) Compose to create your HTML mail. This
      creates your mail using inline styles and that's the reason for what you
      say.

      In place of using inline styles you "can" use a stylesheet which makes
      for a cleaner document. The problem is that Moz Mail does not allow
      access to the head section, so the stylesheet ends up in the body
      section. Although this is contra-standards, it does work when read by
      O/OE and Moz Mail. There are enough contra-standards regarding mail that
      this will be just another added 'feature'.

      In order to be conforming, however, I have used the "InsertHTML "
      extension with Thunderbird (probably also works with Moz Mail) which
      gives access to the head section, works very well and is available here:
      <http://nic-nac-project.de/~kaosmos/edithtml-en.html>

      --
      Gus

      Comment

      • Pawel Knapik

        #4
        Re: Turning Off CSS

        ctiggerf napisał(a):[color=blue]
        > Is there a simple way to quickly turn off all css styles for a section
        > of a page.
        >[/color]
        [...][color=blue]
        > There's got to be a simple way to turn off the styles for just one cell
        > in a table or a div or something. I know you guys will know the
        > answer.[/color]

        You want to do this on a HTML document inside the browser
        window?

        Consider this situation:

        <style>
        body { font-size:3em; }
        ..someClass { font-size:0.5em; }
        </style>

        in your HTML you have, say, <div class="someClas s"></div>

        Now, using JS you can remove the class or css rules for this
        class. But then style will be inherited, so you won't be any
        bit closer to "unstyled" version of this element.


        If the element you want to see unstyled has and id you can
        try this:

        javascript:var
        w=window.open(' ','prev','width =400,height=500 '); var
        b=w.document.cr eateElement('di v');
        b.innerHTML=doc ument.getElemen tById('ELM').in nerHTML;
        void(w.document .body.appendChi ld(b));

        where ELM is the id of element you want to preview.
        Paste the code into your browser's address bar (in one
        line), change ELM to the id of element you want to see and
        press [enter]. Tested in Firefox, but should work in other
        browsers as well.

        In fact the contents of preview window won't be unstyled but
        will use browser's default stylesheet. You can play with the
        JS and change it to generate a window that uses for
        example { font: 1em courier, monospace; } but it's not a
        topic for this group.

        Have fun :)

        Comment

        Working...