There's not really much of a secret to learning frontend development (or any skill, for that matter). You have to practice to really enforce what you are learning and intentionally grow your skills. That is why I was so excited when I learned about frontendmentor.io
This site has tons of free challenges to help flex and hone your frontend skills. They are essentially prompts with design files. There are no "right" answers per se. There are multiple ways to achieve the designs you are building. You can submit your solutions for feedback and you will receive a report outlining any accessibility and HTML issues in your code.
Personally, I think this is an ideal method for learning and I wish I knew about frontendmentor.io sooner. I dove right in and tackled these three "junior" level designs to see how I stacked up: