DEV Community

Cover image for Must know CSS code.
Waleedh Nihal
Waleedh Nihal

Posted on • Edited on

2

Must know CSS code.

  1. display:flex;

2.justify-content:center;

3.align-items:center;

4.background-image:url(./whatever-image-you-have);

5.background-repeat:no-repeat;

6.font-weight:bold;

7.background-size:cover;

Lets Go!

Top comments (2)

Collapse
 
lensco825 profile image
Lens

Great examples! You should also add background-size: cover since it makes sure the whole content of the backgroud image is visable. Here's a quick example i made:


Collapse
 
waleedh profile image
Waleedh Nihal

Ok thx

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay