Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

QR Code first solution

@Marutovsky

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hi!

  1. Is it ok in this case to use html elements in my css file instead of using classes?
  2. What with the mobile design? I didn't do nothing to get it, but when I resize the screen it looks good.
  3. I'm curious about the way I pushed footer to the bottom of the page.

Feel free to leave any feedback, thanks!

Community feedback

Dieu Donne 150

@d-donne

Posted

To answer your question on using elements (Tag names) as CSS selectors, there's actually nothing wrong with it if you want elements of that type to have a general styling.

Class Names Have Higher Specificity Than Tag Names.

When you give that element a class name, the CSS styling using the class name will override the Tag name's styling affected by that CSS property.

For instance:

HTML

<p class="text-red"  id="text-green">

CSS

p {
  background-color: black;
  color: white;
}

.text-red {
  background-color: yellow;
  color: red;
}

#text-green {
  color: green;
}

If this paragraph is styled using the CSS, it'll actually show a green text with a yellow background, because IDs are more specific than class names, and class names than Tag names.

Here is an article I found: Importance of CSS Specificity

Marked as helpful

0
Misaponce 170

@Misaponce

Posted

Hi Damian your solution looks good, is pixel perfect 💯

In my opinion it is ok to use CSS element selector since it is one of the ways to achive that, you can also use ID and Classes selector either one or the other is fine.

I think using semantic HTML is what did the mobile design easier and to get the footer all the way to the bottom, try using margin-top: auto on the footer element

Marked as helpful

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord