Abel did not just dream up the proper sacrifice to God of that time on his own, simply because it was not specifically written how he knew what would please God.
Heb 11:4
4 By faith Abel offered unto God a more excellent sacrifice than Cain, by which he obtained witness that he was righteous, God testifying of his gifts: and by it he being dead yet speaketh.
(KJV)
For that to be said of Abel, it has to mean he had The Faith, revealed to him by God. Thus, the following applied to righteous Abel's Faith also...
Heb 11:13
13 These all died in faith, not having received the promises, but having seen them afar off, and were persuaded of them, and embraced them, and confessed that they were strangers and pilgrims on the earth.
(KJV)