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

Responsive Product Preview Card

P
Fabian 150

@slowjo

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Span without text-decoration inside a paragraph that has text-deco?

For the part that shows the large, green updated price and the crossed-out old price next to it, I wanted to style the whole paragraph with text-decoration: line-through; and then just have a span inside this paragraph that has all the large text and color styling, and text-decoration: none;

However, it seems this is not possible, since text-decoration: none; did not get rid of the line through the updated price. Eventually I just styled the whole paragraph green and with large text and had the small, crossed out part in a span with text-decoration: line-through;

It is actually easy to do it like this but I was still wondering if anyone has encountered a similar problem with a span inside a styled paragraph where you could not 'undo' the paragraph styling inside the span? Or do you have a neat solution for this type of issue?

Community feedback

@HugoAlbuquerque1993

Posted

Pay attention to responsiveness between 750px and 900px. Other than that, it's perfect.

0

P
Fabian 150

@slowjo

Posted

Oh, I see what you mean. Thanks a lot for pointing this out! Nice reminder that it is always better to slide through the whole screen-width range instead of just checking for full screen and mobile.

1

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