no worries, please consider not posting the solution next time though. (we want to have less of solutions in the forum, and more support in terms of hints/tips/guides)
the browser knows that everything inside the css is to be applied to everything in the html file because of this line:
<link href="styles.css" rel="stylesheet"/>
If the code had more than one img, and you wanted different styling for each one, then you would use a different selector like the id selector (ids have to be unique for each element), or you could also tell the browser which img you wanted by its location (such as telling it to pick the first img child of a div for eg or the last img child of a body etc).