mardi 9 mai 2017

Using parameters or existing vars in CSS

I added CSS to a checkbox and it works just fine. I use a local file (named check.png) to use as the check background image and crop it inside the checkbox area.

Here are two checkboxes one checked and one unchecked

Now I'd like to know if it's possible, instead of manually setting 25px in the CSS file, to get the background image's real width and height and set the width to background.width and the height to background.height/2.

That would allow to have it automatically resize if I ever change check.png and still work properly




Aucun commentaire:

Enregistrer un commentaire