Read and set CSS

css() sets inline styles. width(), height() and offset() give numbers.

jQuery · Read and set CSSBeginner
$('#box').css('color', 'green');

$('#box').css({
  'background-color': '#eef',
  padding: '12px',
  borderRadius: '8px',
});

const color = $('#box').css('color');
const width = $('#box').width();           // number, no 'px'
cssstylewidthheight