Decrease padding above heading styles on pages

Hi, Thank you for trying to help me! I added this code below as a test, to my assets/theme.css.liquid but the padding has remained the same in all instances. (I didn’t have theme.css). Am I putting it in the wrong place?

/* Adjust padding above specific headings */ h1 { padding-top: 13px;} h2 { padding-top: 11px;} h3 { padding-top: 9px;} h4 { padding-top: 7px;} h5 { padding-top: 5px;} h6 { padding-top: 3px;}