homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

Override CSS Rules
Including HTML Page in Joomla Template

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


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!




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

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


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

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?


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


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?


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

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?


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

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.


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]

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved