a Lateen Sail
ships could sail against the wind.
Allegedly, the lateen sail design made it possible to sail closer into the wind. That is, less than 45 degrees from the direction the wind is blowing. No sail boat can sail directly into the wind. Yet.
the reason why caravels could sail against the wind is because they had a very big triangular cloth which would let them flow with the wind
the caravel has triangular sails as well as square sails. Square sails carried the ship forward when the wind was at its back. Triangular sails allowed the caravel to sail into the wind. the caravel was better than other euoopean ships of the time at this type of sailing
Wut made ships sail in the wind was that using a persicet sail or flag will pick up the wind and will push the air out and sail..just like u swinging on a swing 
Lateen Sails
Caravels were a type of small, highly maneuverable sailing ship developed by the Portuguese in the 15th century. They were better than the ships they replaced, such as cogs and carracks, because they had a more streamlined hull design, allowing for greater speed and agility. Caravels also had triangular lateen sails that could catch wind from different directions, enabling them to sail closer to the wind and explore new trade routes more efficiently.
It is not possible to sail directly INTO the wind. Forty-five degrees is about as close as can be gained. Actually they did get the ships to sail into the wind. The above answer is wrong.
In the ancient world the square sail on "square rigged ships" was employed universally in the Mediterranean on the seagoing ships of the Egyptians, Phoenicians, Greeks and Romans. In Hellenistic and Roman times a spritsail (triangular sails) was sometimes set on a small raking foremast, known as an artemoon, in order to sail with a beam wind.
A three sided sail is known as a Lateen sail or also a triangular sail. With a four sided sail one is only able to sail against the wind, but with a Lateen sail it is possible to sail more directly into the wind.
No sailing ship can sail directly into the wind. However by rigging the sails correctly the vessel can be made to sail more closely to the wind.