473,379 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

override part of css

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
3 9490
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: brett | last post by:
If I want all text, no matter where it is, to be gray, is there a way to override styles and have that color take affect? It would need to override DIVs, tables, SPANs, anywhere inline styles are...
7
by: Thomas Kehl | last post by:
Hello. I provided a class, which derives from the class DataView. The only thing, which I would like to do in this class am to overwrite the Property COUNT. I wars it however simply not. I get...
14
by: JPRoot | last post by:
Hi I use the following syntax to have events inherited from base to child classes which works nicely (virtual and override keyword on events). But I am wondering if it is a "supported" way of using...
11
by: z_learning_tester | last post by:
Hello, yes another beginner question that I'm sure is obvious to many here :-) My book is so bad. Really. It uses the exact same example of code for using the new kw and for using virtual(in the...
4
by: Gecko | last post by:
I noticed that every time I override a class member, the intellisense behavior is to automatically add a call to the base class of the overridden member such as: public override void...
5
by: Stoyan | last post by:
Hi All, I don't understand very well this part of MSDN: "Derived classes that override GetHashCode must also override Equals to guarantee that two objects considered equal have the same hash code;...
3
by: Richard | last post by:
I have a requirement to put a GDI style circle or rectangle border around the selected row of a datagrid/ It will overlap into the row above and below the selected row. Doing this in a the OnPaint...
5
by: Jim Corey | last post by:
I've just learned that the app I've been working on is going to be deployed to a web farm. The app uses session variables, and I've been told that I want to use some other technique. I was...
21
by: bonk | last post by:
Did anyone EVER come across the need to use "new" in a method declaration (breaking with inheritance / versioning)? Allthough I know what it does and how it is used I really have a hard time to...
3
BeemerBiker
by: BeemerBiker | last post by:
I want to use the C# example shown here Ok, I have done simple overrides before so I coded up protected override Auto... well, I didnt even get that far as intellisense made it clear that...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.