Is there a specific way that css selectors or properties should be ordered?
Devon Daniels
@DevDan21All comments
- @iormesSubmitted over 1 year ago@DevDan21Posted over 1 year ago
I think in some cases they do matter however I'd put more importance on making sure that you're selectors and properties are well organized. It makes it easier for you to look it up when you need to make a correction or change a property as well as for others that you might be collaborating with.
This is the way in which I work and strive to get better at.
Hope this helps!
1 - @MachineCode0101Submitted over 1 year ago
Centering the div vertically was unironically the most difficult part, and I still haven't managed it! so I did some hacks using "padding-top:30%" to have some space to the top of the screen/page. I did try grid and flex, with content, align and item properties to center my content but I just couldn't get it centered vertically!
How can I improve the centering of the content?
@DevDan21Posted over 1 year agoHi Matin
CSS>body - I would remove the following:
place items: center; padding-top: 30%;
and add the following:
justify-content: center; align-items: center; min-height: 100vh;
So that it looks like the below:
body { display: grid; justify-content: center; align-items: center; min-height: 100vh; text-align: center; font-family: "Outfit", sans-serif; background-color: hsl(212, 45%, 89%); }
Hope this helps buddy!
Marked as helpful1