Welcome to WebmasterWorld Guest from 107.20.5.156

Forum Moderators: not2easy

Message Too Old, No Replies

Override CSS Rules

Including HTML Page in Joomla Template

     

Birdman

2:50 pm on Jan 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

I'm trying to figure out a way to override any CSS rules that have been defined already.

Here's the deal:

I have a Joomla site and I am dynamically including other web pages(mine) into the Joomla content area. These are prebuilt salesletters that I have rights to and they are all pretty much old school tabled designs with lots of <font> tags.

Unfortunately, the defined styles seem to override the inline font elements and it is messing the pages up.

Is there a way to say "No styles inside this element"?

Thanks in advance!

Marty

coopster

8:16 pm on Jan 5, 2008 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Anything in the Global or Universal reset - reset.css [webmasterworld.com] thread helpful?

Birdman

9:41 am on Jan 7, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Coopster, that was very interesting. Unfortunately, it doesn't look like it will work for me :(

I am mainly having trouble with font sizes and colors. The HTML of the included page has this type of coding:

<p align="center"><font face="Verdana" size="4"><strong><font color="#cc0000" size="5"><br />

(yes, very ugly)

What I really need is a way to make what's inside my wrapper "forget" that any CSS is defined, rather than resetting it to a default. Resetting to default still wouldn't allow the font tags to take control.

I guess I may have to use an iframe?

SuzyUK

10:47 am on Jan 7, 2008 (gmt 0)

WebmasterWorld Senior Member suzyuk is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Birdman,

I'm confused, easily done really, in that case you gave above the inline <font> styles should NOT be overridden by imported or embedded CSS, are you saying they are?

Is Joomla converting the code after it's input?

Birdman

3:24 pm on Jan 7, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Suzy,

Thanks for the assistance.

Yes, it seems that the font attributes are NOT overriding the styles :(

Joomla! couldn't have converted anything because I tested by viewing source with Opera and then making my edits and clicking "Apply changes". (a pretty cool way to test)

When you set a color with the color(et al) "attribute" is it exactly the same as setting it with CSS?

SuzyUK

6:13 pm on Jan 7, 2008 (gmt 0)

WebmasterWorld Senior Member suzyuk is a WebmasterWorld Top Contributor of All Time 10+ Year Member



hmmm, I see - just to check am I right in thinking that you want to keep the Sales Letters in their original format ;)

try this:

p {text-align: left; color: #000; font-size: 10px;}
font {color: #000;}

<p align="center"><font color="#ff0000" size="5">hello world</font></p>

the <p> CSS on it's own overrides the text alignment on the <p> but not the color or size of the text. The <font> element's CSS overrides its HTML attribute, so it seems CSS is more specific that presentational HTML, but it still has to be set on the correct element. Does this mean you have <font> overrides in your CSS or are some of the attributes on other elements in the imported HTML?

In theory it should be possible to restore the natural formatting with specificity and

font[color="#ff0000"]
- 5.8 Attribute selectors [w3.org] - depending on how consistent the HTML formatting is, but of course support is sadly lacking in IE (even IE7 has problems [webmasterworld.com])

However I'm wondering if those Sales Letters are consistently formatted enough you could use specificity, descendant selectors and those <font> tags to re-write the CSS so it's similar to the original look?

When you set a color with the color(et al) "attribute" is it exactly the same as setting it with CSS?

Not quite wrt the example above - CSS seems to have more specificity, in the example above the embedded CSS would NOT override inline CSS, but it does apparently override HTML attributes.

-Suzy

just a PS: does Joomla use any default stylesheets, like Yahoo's reset, by any chance?

[edited by: SuzyUK at 6:18 pm (utc) on Jan. 7, 2008]

 

Featured Threads

Hot Threads This Week

Hot Threads This Month