Why is the jquery not firing from inside this if statement?

Why is the jquery not firing from inside this if statement?

I'm working with this media query:

@media only screen 
  and (min-device-width: 414px) 
  and (max-device-width: 736px) 
  and (-webkit-min-device-pixel-ratio: 3)
  and (orientation: portrait) { 

            .my_span{font-size=2.5em}

I want to manipulate the element when being viewed by a mobile device.  I check for resizing here...
$(document).ready(function() {
    checkSize();

    
    $(window).resize(checkSize);
});

then I try to show an a simple alert if the statement is true..
function checkSize(){
                              if($(".my_span").css("font-size") == "2.5em" ){
                                   alert("hello");
                             }
 
}

The "if" statement is not working.  Am I using the wrong syntax?  Thanks for any help with this problem.