I want to identify three cases:
1.) Stuff you need all the time, like printf or scanf in C. You probably don't need to memorize it, because you'll do it automatically.
2.) Stuff that you need only very rarely or even only once. No need to memorize it, especially not if it just serves to frustrate you.
3.) Stuff that doesn't come up all the time, but just often enough that you forget - and regret.
In the last case, memorization techniques (see above) in my opinion can really help.
Memorization, whatever it is, comes down to
2.) applying and
The last point is the tricky part: If you don't use an information item for a while, your brain will delete it.
There are counter measures though:
I doubt that it's humanly possible to memorize every programming language unless you are some kind of savant or have a photographic memory. There are hundreds of programming languages. For an extensive but incomplete list see...
You could write a simple database management system where you store typical code snippets together with appropriate keywords. This is the main reason why I learn Python these days. I want to be able to have small portions of code readily available within a GUI, made of Tkinter and a database based on SQLite.
You can't even memorize HTML by it's self I mean are you aware of how many table commands their are? Even pro's don't know them all. I recommend just learning the basics and not trying memorize everything you'll just get depressed and want to quit.