<!-- 任意对象,直接获取他们的 x , y 都是为0; $('#xxx').css('x','y'); --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <a href="">sdf</a> <div class="one">sdlkfsd</div> <div class="two">sdlkfsd</div> <div class="three">sdlkfsd</div> <div class="four">sdlkfsd</div> <div class="five">sdlkfsd</div> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script type="text/javascript"> console.log($('.five').css('x')); console.log($('.five').css('y')); console.log($('.one').css('x')); console.log($('.one').css('y')); console.log($('.two').css('x')); console.log($('.two').css('y')); </script> </body> </html>