DEV Community

Cover image for Daily Code 72 | Final Lesson (🟥 HTML & 🟦 CSS Course 14)
Gregor Schafroth
Gregor Schafroth

Posted on

Daily Code 72 | Final Lesson (🟥 HTML & 🟦 CSS Course 14)

Now finally the last lesson of this course! https://www.youtube.com/watch?v=G3e-cpL7ofc

Today we just learend some miscellaneous leftover things about html and CSS, such as media tags and comments. I put them in the comments below

My Code

With media tags I can adjust how my website looks for different screen sizes. The code below shows 1, 2, 3, or 4 video thumbnails per row depending on the size of the browser window, just like the real YouTube

@media (max-width: 599px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 600px) and (max-width: 899px) {
  .video-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) and (max-width: 1199px) {
  .video-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (min-width: 1200px) {
  .video-grid {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}
Enter fullscreen mode Exit fullscreen mode

Comments in html work like this

<!-- here goes the comment -->
Enter fullscreen mode Exit fullscreen mode

and in CSS like this

/* here goes the comment */
Enter fullscreen mode Exit fullscreen mode

And that was it! The course was a great way to get an overview about HTML and CSS, which I preferably should already have had before I jumped into JavaScript. Well better late then never 😄

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more