Matt Helm: (10/24/2007)
I have a question. Why can't we just use the css names. Example: instead of using your style "backgroundColor", why not just use "background-color", as in css? Why can't we change that? Later

davidserduke: (10/27/2007)
The answer is: You can.

Look again at the examples and you'll see it works both ways as long as you put the property in quotes like:

.css("background-color", "yellow")

.css("backgroundColor", "yellow")

But you can also use the latter method without quotes if you are using an object literal like:

.css({ backgroundColor: "yellow"})

.css({ "background-color": "yellow"})

Yasmary Mora: (12/18/2007)
Using "blue" or "red" or "black" throws an error in Internet Explorer 7. Use hex values.

[edit]

modifying css sub-elements

If i have a class and i want to modify the anchor tag CSS values of it - is that possible?

Here's what i'm trying

css:

.my_element { font-size: 10px; }

jquery:

$("a.my_element:link").css('color','red');

i've tried a few methods and no joy. $(".my_element a:link").css('color','red');

Guessing i'm doing something wrong.

[edit]

css and background images?

Hello,

I have a timer that changes the header image using .css( { background: "url('image.gif'" } ) and it does work, changes perfectly the way i want it to.

the problem is (i tested this without the timer as well) whenever it changes the images, every 15 seconds, my page automatically scrolls to the top.

thats a problem for me because what if the user reads something at the bottom when the image must be changed? I cant make it stay there after it changes the .css for the background.

any ideas? why does that happen?

thank you.