Return to Snippet

Revision: 47219
at June 2, 2011 23:02 by jquery4u


Initial Code
$('jQuery selector').css({"css property name":"css property value"

//change paragraph text colour to green
$('p').css({"color":"green"});
 
//float all divs with class .left
$('div.left').css('float');
 
//change all elements with class .bg-red to have a red background
$('.bg-red').css({"background-color":"red"

newimg.css('background-image': 'url('+newimgsrc+')');
newimg.css('position': 'absolute');
newimg.css('height': '70px');
newimg.css('width': '200px');
newimg.css('top': '68px');
newimg.css('right': '2px'

Initial URL
http://www.jquery4u.com/dynamic-css-2/change-css-jquery/

Initial Description
Read more here: http://www.jquery4u.com/dynamic-css-2/change-css-jquery/

Initial Title
jQuery Change CSS Dynamically

Initial Tags
jquery

Initial Language
JavaScript