/ Published in: JavaScript
Read more here: http://www.jquery4u.com/dynamic-css-2/change-css-jquery/
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$('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'
URL: http://www.jquery4u.com/dynamic-css-2/change-css-jquery/