|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ignore styleHi,
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? Giorgio wrote:
> Hi, Don't think so. AFAIK, inline styles override style sheets.> 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 should probably post this to a CSS group: http://groups.google.com/groups/dir?sel=33584039 -- HTH, Bob Barrows Giorgio wrote:
> Hi, You could try and strip those inline styles out before writing the tags> 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? to Response ... probably not an easy task. -- HTH, Bob Barrows Giorgio wrote:
> Hi, As Bob said, due to the cascading nature of style sheets, when you apply > 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? 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 > inside an Access db I've a lot of records with html text (like <p You're either going to have to strip out the inline styles as someone else> 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. 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
Other interesting topics
How to redirect after ALERT.
MSXML installation help infinite hierarchy webpages Sorting like Amazon DVD system History.go with asp. Behavior of ADODB.Command .Execute changes on different servers??? Re: Looking up ISP domains from IP addresses Is ASP programming still supported in latest visual studio? ASP.Net 2.0 Excel app requires MS Office on webserver Membership ApplicationName |
|||||||||||||||||||||||