Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

percentage in jquery css Positioning

Why the JQuery syntax below is not correct:

 $('#Footer').css({ right: 6%, bottom: 0 });  

And this one is:

 $('#Footer').css('right', '6%');
 $('#Footer').css('bottom', '0');

What is incorrect in the first code ?

Thanks in advance

like image 841
SilverLight Avatar asked Feb 21 '26 04:02

SilverLight


1 Answers

6% is not a number, so it must be specified as a string.

$('#Footer').css({ right: '6%', bottom: 0 });  
like image 143
kapa Avatar answered Feb 23 '26 18:02

kapa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!