I think <size=40>text</size> is wrong, but my friend says it's correct under some circumstances?

As far as I can tell,


is a wrong use of html tags,

since size is an attribute, not an element.

Plus, when I put <size=40>text</size> into an online HTML previewer, the text didn’t resize to 40. Nothing happened.

I think it should be <font size=40>text</font>.

I have researched this over and over again. I don’t think I’m wrong?

But my friend who has studied CSS for a while said <size=40>text</size> can be correct under some circumstances.

He mentioned the CSS Sheet.

I tried researching this CSS Sheet, but I still cannot connect the dots why he said so. He won’t elaborate further.

I understand this might be too basic a question to ask, but I have really done all I could do to try to figure this out on my own.

Please tell me if <size=40>text</size> is wrong? Under what circumstances can this be correct??

Thank you so much!

The only circumstance this would be valid is if someone defined a custom HTML element but there would be no point as CSS already has a property to handle this (font-size).

Before HTML5 came along, there used to be a font tag but it is not supported on all or most browsers. Even when it was supported, the size attribute allowed values were 1-7.