During the Permian Period, some 250 million years ago (MYA), future Africa was encased within the combined land mass of Pangea. Then, about 200 MYA, the Tethys Sea began to open, splitting Pangea from east to west and separating the northern continents (Laurasia) from the southern land masses (Gondwana); future Africa was part of the latter.
About 160 MYA, Madagascar split from southeast Africa and, 10 million years later, the Atlantic began to open. The combined mass of Africa and South America rifted from Antarctica about 140 MYA and the final separation of Africa and South America occured 100 MYA as the Atlantic Rift spread southward. As the Indian Ocean widened, some 50 MYA, the Tethys Sea began to close and Africa drifted northward to collide with the Eurasian Plate, crumpling up the Alps; the Mediterranean Sea is a remnant of the Tethys. Finally, the East African Rift began to form about 40 MYA; as the Red Sea opened, the Arabian Plate split from Africa and, today, continues to move to the northeast, colliding with southeast Asia. A string of lakes and volcanic summits through East Africa delineates the course of the Rift and marks the future edge of the Continent; as the rift continues to spread, the sea will invade its channel and a new land mass will split from the east side of the African Plate.
All of our planet's land masses have been molded in this way as seas open and close, causing the continental plates to merge or rift apart. The current map of our globe is but a snapshot in the 4.6 billion year history of Earth's evolution, a process that continues today.