Home All Groups Group Topic Archive Search About
Author
17 Apr 2009 3:23 PM
Giorgio
Hi,
inside an Access db I've a lot of records with html text (like <p
style="color:red">, <font color="green">, ...) but I'd like to ignore the
style given to each text and use my css to show these texts.

Could you help me please?

Author
17 Apr 2009 3:58 PM
Bob Barrows
Giorgio wrote:
> Hi,
> inside an Access db I've a lot of records with html text (like <p
> style="color:red">, <font color="green">, ...) but I'd like to ignore
> the style given to each text and use my css to show these texts.
>
Don't think so. AFAIK, inline styles override style sheets.

You should probably post this to a CSS group:
http://groups.google.com/groups/dir?sel=33584039

--
HTH,
Bob Barrows
Are all your drivers up to date? click for free checkup

Author
17 Apr 2009 3:59 PM
Bob Barrows
Giorgio wrote:
> Hi,
> inside an Access db I've a lot of records with html text (like <p
> style="color:red">, <font color="green">, ...) but I'd like to ignore
> the style given to each text and use my css to show these texts.
>
> Could you help me please?

You could try and strip those inline styles out before writing the tags
to Response ... probably not an easy task.

--
HTH,
Bob Barrows
Author
17 Apr 2009 4:15 PM
Dooza
Giorgio wrote:
> Hi,
> inside an Access db I've a lot of records with html text (like <p
> style="color:red">, <font color="green">, ...) but I'd like to ignore the
> style given to each text and use my css to show these texts.
>
> Could you help me please?

As Bob said, due to the cascading nature of style sheets, when you apply
style directly to an element that is the style that is used. You *might*
be able to get around it by using !important in the style sheet after
every single style declaration:

p {
    font-color:red!important;
}

Your best bet is to prevent them going into the database in the first place.

Steve
Author
18 Apr 2009 3:12 AM
JM
> inside an Access db I've a lot of records with html text (like <p
> style="color:red">, <font color="green">, ...) but I'd like to ignore the
> style given to each text and use my css to show these texts.

You're either going to have to strip out the inline styles as someone else
has already suggested, or do one of the following:

Either make sure the tags in question have either ID or class selectors and
then flag them as !Important or, simply create a new style for the <p>
element..

<p style="color:red">
<p class="mycolor" style="color:red">
<p id="acolor" style="color:red">

<style>
.mycolor{ /* class selector */
   color: blue !Important;
  }
#acolor{ /* ID selector */
   color: blue !Important;
  }
p{ /* element would be easiest */
   color: blue !Important;
  }
</style>

Any one of which should turn the paragraph text blue - even if it has
an inline style that specifies a red font.

Inline styles have a specificity of 1000 which basically means that it
will always take precedence with one exception. You guessed it - it's
all about being !Important

John

Bookmark and Share