#test will take the element with the id test while div#test will only take the div with an id named test.
This doesn't make a great difference since ids have to be unique.
This kind of info is pretty easy to find, you may want to take a look at W3schools documentation