It is possible to learn both . The best way to learn both of them is to do mini projects. For example if you create a web based chatbot, you would be applying web development skills with machine learning concepts, in this case Natural Language Processing(NLP).
Read moreWhere is machine learning used in web development?
We all have come across various web applications that use machine learning. For example, Netflix and YouTube use ML to personalize your experience by recommending you new content based on your viewing history. This helps them make better decisions and understand the browsing behaviors of their users.
Read more