Sci-fi isn't the opposite of fantasy, just a sciencey flavour of it. Before some nerd tries to pick a fight about semantics of speculative fiction genrefication, do know that I am correct. A true connoisseur of contrarianism would be particular to sober literary fiction.
The difference between the Science-Fiction and Fantasy is that the former focuses on the technology while the latter focuses on the supernatural forces.
The said technology in the science fiction doesn't have to be real, or scientifically proven or even possible in the real world, but it has to be explained scientifically within the context of their own fictional universe. It's not important whether it is realistic, it is important that it is clear from the context we are not seeing supernatural forces at work.
The fantasy focuses on the supernatural forces like the mythological creatures, magic and similar.
Science Fantasy is where both are mixed together. It is usually clear from the context what is (advanced) technology and what is inherently supernatural.
There used to be terms as hard sci-fi which is supposed to only portray technologies which exist at the time of the work creation. This term lost its meaning a long time ago when the successful writers call their works "hard sci-fI" only as the badge of honor for selling a lot of books.