jquery css multiple line

Solutions on MaxInterview for jquery css multiple line by the best coders in the world

showing results for - "jquery css multiple line"
Valerio
16 Aug 2019
1/* To avoid writing the same line several times 
2   You can use multiple lines in the css function*/
3
4    $('.selector').css({
5     'font-size' : '10px',
6     'width' : '30px',
7     'height' : '10px'
8	});
9
10/* Obviously you can store these value in a variable too */
11
12	var style = {
13     'font-size' : '10px',
14     'width' : '30px',
15     'height' : '10px'
16	}
17
18    $('.selector').css(style);
19
20