Please I am having a problem with the original price, I can't center it. And any correction from you guys will be much appreciated, Thanks.
Kevin Pernia
@kevin3080All comments
- @MaxiTeddySubmitted over 2 years ago@kevin3080Posted over 2 years ago
my solution would be to treat the entire pricing section as a "display:flex" so they align next to each other(in your div), then I can use "gap" a 16 or 6px to separate them, and finally "align-items: center". (for your <p> tag to inherit these properties, you need to disable your display: in-line and the margins you placed. This way you make sure that the two price elements are always centered
Marked as helpful0 - @alphardhafizSubmitted over 2 years ago
how the best practice in this case? use grid or flexbox?
@kevin3080Posted over 2 years agoAs the project is, it is more recommended to use flexbox. When we describe flexbox as one dimensional we highlight the fact that flexbox handles layout in only one dimension at a time — either as a row or as a column. This contrasts with the two-dimensional model of the CSS Grid Layout, which controls columns and rows at the same time.
The display: grid statement gives you a single column grid, so your elements continue to display one below the other, as they do in the normal flow. To see something that looks more like a grid, we need to add columns to the grid.
Marked as helpful0