Don’t focus on “holding the knowledge” in your brain, you want the stuff you learned to get into your “muscle” memory, and the best way to do that is practice. At the start you might have to look some stuff up, and thats ok and to be expected. Even after tons of practicing you might have to lookup some things here and there. Simply put CSS and HTML have a lot to remember. Looking things up and knowing how to get answers is just as important as knowing what you can lookup.
The best way to expand your knowledge horizon is just to experiment. Places like MDN go over HTML, along with a bunch of other topics for web development. Just randomly reading a long might introduce you to newer ideas and concepts you can go learn more about.
HTML/CSS can be seen as the web “content”, but JS is where you build stuff to do stuff. You can build stuff with just HTML/CSS, but what you can build is limited. With JS you can build anything.
Good luck, keep learning, keep building!