Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

CSS: How to give space between backgorund-image and text (with the given properties)?

I’m learning CSS and I have an assignment where I’m given 12 properties and I need to create this button…

These are the properties given to me.

The button I need to create.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

This is how my button looks like.

My code.

I tried everything but I couldn’t give a space between the image and the text… help me 🙁

>Solution :

What you need to set here is your padding-left and set your background-position-y: to either 0px or left;

padding is a shortcut for padding-left , padding-top, padding-right, padding-bottom

You can do your padding as either padding: 15px 15px 15px 50px;
this will make it 15px and padding-left: 50px;

or you can make it

padding: 15px;
padding-left: 50px;

in this specific order

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading