Forum Moderators: not2easy

Message Too Old, No Replies

CSS over ride a parameter in CSS

Newbie question

         

ildarius

7:18 pm on Apr 22, 2008 (gmt 0)

10+ Year Member



Good day guys and gals

Hope there is a simply solution for this

I have recently integrated a form into my site and it has a bunch of CSS files included in it.
Some of those CSS override my own file...

For example i have a DIV called Footer and i have set in my settings
that the font color should be black for all of the text in that DIV,

but their CSS overrides this setting and i cannot touch their CSS since they do not allow it..

Thank you for your help!

Marshall

1:25 am on Apr 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you can, make the "footer" div like this to override pre-formatted CSS:

<div id="footer" style="color: #000;">content</div>

An in-line CSS will override CSS in the <head>.

Marshall

ildarius

2:35 am on Apr 23, 2008 (gmt 0)

10+ Year Member



Thank you for the answer!
When you say inline, do you mean i will put
it directly into the html source?

swa66

12:17 am on Apr 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Learn a few things about specificity [webmasterworld.com...]
It'll help you.

If you include foreign made CSS to control an inline content/generated element, you'll need to read it up a bit (esp if it's (and many are unfortunately) laced with hacks it can be tricky (you might break the hack ...)

What I've done in the past:
wrap the generated content in <div id="widget">
and then add in front of the all the individual selectors in the inherited CSS, a #widget
e.g.

a:hover, #title {color:red}

becomes
#widget a:hover, #widget #title {color:red}

But take care with hacks using selector bugs as they might trigger differently due to such a change.

Alternatively, move your names out of the way of those of what you include from a foreign source.

Marshall

6:27 am on Apr 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thank you for the answer!
When you say inline, do you mean i will put
it directly into the html source?

Yes. Right in the <div> tag.

Marshall

ildarius

12:07 pm on Apr 24, 2008 (gmt 0)

10+ Year Member



Thank you SWA i will try that, i tried the previous solution, but i
did not specify that the text is a link.
What do you mean when you say hack?