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

Currently Learning HTML & CSS. Coded this design for Practice

Nora 20

@Nes228

Desktop design screenshot for the Single price grid component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I could not figure out how to move the text "per month" up a little so that it is not on the same line as "$29"

I notice the text in the design has a "softer" look. How can I also achieve this?

Also I obviously could not figure out how to add the little shapes to the outside light gray container.

Community feedback

Axel 150

@Axel01011111

Posted

Adding this in css fixed it

span.per-month{ position: absolute; }

hope it helps

1

Nora 20

@Nes228

Posted

@Axel01011111 thank you very much. Can you explain how that fixed it? I dont understand.

0
Greta 340

@gretagr

Posted

Position absolute takes an element out of normal document flow, and then with parameters top, left, bottom and right you can adjust its position.

Important to know - when you use position: absolute, it aligns itself within top: 0 left: 0 positions of a parent (in most cases Html element). To position it relative to its parent element, you should set position: relative(or any other than static) to the parent element.

I tend not to use absolute positioning unless there is no other option, because it can cause tons of problems especially if you do not fully understand the principles of positioning.

In my solution, I used the parent element to hold those two and centered them with flex-box:


<div class"flex-parent">
  <span>29</span>
  <span>monthly</span>
</div>

CSS: 

.flex-parent {
  display: flex;
  align-items: center;
}

As for the softer look: I think it is looking softer because of image resolution/quality thing. Your website is sharper, it is not restricted by anything.

Shapes outside the container are only there for representational purposes. Those are not in an actual design. If you would want to add them anyway - this is where positioning or multiple backgrounds may be useful.

3
Nora 20

@Nes228

Posted

@gretagr Thank you so much for your helpful comment! I appreciate it so much. I know nothing about fex-bot, but I think that is the next topic I want to learn about.

0
Greta 340

@gretagr

Posted

@Nes228 Oh, you definitely do! flex-box will make your life sooo much easier! :))

Here are some of my favorite flex-box resources:

flex-box complete guide: https://css-tricks.com/snippets/css/a-guide-to-flexbox/ flex-box cheat sheet: https://yoksel.github.io/flex-cheatsheet/ flex-box learning game: https://flexboxfroggy.com

Good luck!

2
Nora 20

@Nes228

Posted

Awesome. Thanks!

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