This code works on my machine.
Make sure the html file and css file are both in the same folder and css file is named style.css.
style.css
What code editor do you use?