Can I safely remove empty CSS codes?

  • Profile Image
    movz
    Asked on January 27, 2018 at 01:40 PM

    Trying to clean my css up, still don't know much about css but thought I'd start learning albeit slowly.

    Things like this, are they necessary or can I delete what I think is empty css?
    Should there be info within the {  } or does the line serve a purpose?

    1. #cid_16 div.hover {

    }

    2. #cid_16 span.form-sub-label-container {

    }

    3. .form-sub-label-container {

    }

  • Profile Image
    Jim_R
    Answered on January 27, 2018 at 04:49 PM

    That's correct - Those are empty chunks of codes that can be safely deleted. For as long as there are no styles within these CSS selectors, you can safely remove them or keep them there since they are not doing anything in the first place.

    My recommendation is to start with something like W3SCHOOLS https://www.w3schools.com/css/default.asp

    It's a good online resource to learn CSS.

  • Profile Image
    movz
    Answered on January 27, 2018 at 08:32 PM

    Thanks Jim, much appreciated! Have come across w3schools in my css endeavours. Will return there more.