Being a freelance web designer/developer is about deductive reasoning.
I'd hazard a guess that no one knows absolutely everything about every possible development language. That's like saying someone knows every possible word in the English dictionary -- it's merely unrealistic.
What you learn are concepts. You learn the concept of a for/while/foreach loop... then you adjust that concept for the language requirements you are working in. You learn the concept of CSS positioning and then you adjust based upon given HTML and desires.
What you should focus on in terms of specific languages/mark up are the basics. You should understand, in general, what overall function and benefits each language offers over others and when a particular language is best used.
For example (these are very general):
- PHP is server-side scripting, it won't alter anything already present in a browser window. So, it's not appropriate for show/hiding contents on a click but it's perfect for pulling data from a database when a page is loaded.
- ASP, Perl, .Net et al are similar in usage to PHP with their own specific language structures. If you were baking a cake... server-side scripting would be the flour, eggs, and yeast -- the basis for any type of cake.
- Javascript doesn't lend itself easily to layouts and positioning and it doesn't connect to a database directly. However, javascript is perfect for in-browser alterations/animations based on a user's actions such as showing/hiding content on clicks, form validation, etc. And it can be used with php to create ajax functions that will assist in speeding the display of content based upon user interactions. Sticking with the cake analogy... javascript would be the specific ingredients... what makes the chocolate cake chocolate.
- HTML is merely the content it doesn't connect to any database and doesn't offer any direct user integration beyond the click, submit, and button elements. For the cake.. HTML is the pan you bake in which determines the shape of the cake. It's the basic structure which forces your ingredients to a specific shape.
- Cascading Style Sheets (CSS) controls how HTMl looks and allows for some in-browser animation/interaction. For the cake, CSS is the frosting.. the decoration.. the visual experience of the cake.
A freelancer explores each aspect of design/development, then uses that knowledge to determine what may be needed given project specifications. You may not need to know how to create a something specific ... but you should be able to determine what may be needed, and based upon the interaction what the best language to use may be ..... then you go learn how to make that if you don't already know.
After a while your experience and knowledge grows so you do less and less project-based learning and can build faster. But, at that point technology has changed and you need to learn new methods. Web design/development is a never ending learning processes. Start where you are... and start learning....
The primary difference with freelancing here is that you need to be self-motivated and driven because no one is going to tell you what you need to learn because only you know your projects. You have to be able to determine what is needed and how to learn that on your own.