Problem: some character sequences can't be typed

I’m studying html and when i want to put this into a rem:
The HTML document itself begins with <html> and ends with </html>.
this is what happens
image
this is not limited to html studying, also python and different other scenarios such as writing ::
i’d like them to stay the way they are.