By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,317 Members | 1,313 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,317 IT Pros & Developers. It's quick & easy.

override part of css

P: n/a
Hello,

I'm using an external css-file which contains BODY elements.
In one certain page i want to overrule the background-color properties, but
the functions as getElementByTags of byId does not work

any suggestions?

kind regards,
Chris
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Chris Kouwenhoven wrote:
I'm using an external css-file which contains BODY elements.
In one certain page i want to overrule the background-color properties,
but the functions as getElementByTags of byId does not work any suggestions?


I suggest you show us the code that doesn't work, in context (this means
provide a URI, not a bunch of code pasted in to the post) and tell us what
enviroment (browsers, OS) you tested it in.

Its very difficult to tell what's going wrong when you only give us partial
function names that you tried to use!

--
David Dorward http://dorward.me.uk/
Jul 20 '05 #2

P: n/a
Let me first make sure I understand what you mean. I believe you mean
that you have a generic link in your pages to an external stylesheet,
along the lines of ...

<link rel="stylesheet" href="style.css" type="text/css">

... and that it's presumably somewhere in the head. You now want to
override the background colour of something. I'm not sure whether you
mean the actual BODY tag, or just some tags within the body.

If you mean the body then all you have to do is after you've put the
external stylesheet link, put this in your head.

<style type="text/css">
body { Background: red; }
</style>

This will overwrite the stylesheet's body background property, but not
the rest of them.

If you are wanting to change other elements then I'm not sure how you
wish to change them. If you have for example ...

<input type="button" class="buttonclass">

... and you want to overwrite the background colour, then all you have
to do is add in a style attribute.

<input type="button" class="buttonclass" style="Background: red;">

Hope this helps, if not then I'm afraid I've misunderstood your request.
Fred Basset
fr*********@whosyourdaddy.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3

P: n/a
Perfect, Fred

this is the solution, you understand the problem right.

weird, that sometimes the solutions are so easy :-)

Thanks a lot!

Chris

"Fred Basset" <fr*********@whosyourdaddy.com> wrote in message
news:3f***********************@news.frii.net...
Let me first make sure I understand what you mean. I believe you mean
that you have a generic link in your pages to an external stylesheet,
along the lines of ...

<link rel="stylesheet" href="style.css" type="text/css">

.. and that it's presumably somewhere in the head. You now want to
override the background colour of something. I'm not sure whether you
mean the actual BODY tag, or just some tags within the body.

If you mean the body then all you have to do is after you've put the
external stylesheet link, put this in your head.

<style type="text/css">
body { Background: red; }
</style>

This will overwrite the stylesheet's body background property, but not
the rest of them.

If you are wanting to change other elements then I'm not sure how you
wish to change them. If you have for example ...

<input type="button" class="buttonclass">

.. and you want to overwrite the background colour, then all you have
to do is add in a style attribute.

<input type="button" class="buttonclass" style="Background: red;">

Hope this helps, if not then I'm afraid I've misunderstood your request.
Fred Basset
fr*********@whosyourdaddy.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.