Here are three pairs of bases and heights for the same triangle. The dashed segments in the diagrams represent heights.
A segment showing a height must be drawn at a right angle to the base, but it can be drawn in more than one place. It does not have to go through the opposite vertex, as long as it connects the base and a line that is parallel to the base and goes through the opposite vertex, as shown here.
The base-height pairs in a triangle are closely related to those in a parallelogram. Recall that two copies of a triangle can be composed into one or more parallelograms. Each parallelogram composed of the triangle and its copy shares at least one base with the triangle.
For any base that they share, the corresponding height is also shared, as shown by the dashed segments.
We can use the base-height measurements and our knowledge of parallelograms to find the area of any triangle.
The area of Triangle A is 15 square units because 21⋅5⋅6=15.
The area of Triangle B is 4.5 square units because 21⋅3⋅3=4.5.
The area of Triangle C is 24 square units because 21⋅12⋅4=24.
In each case, one side of the triangle is the base but neither of the other sides is the height. This is because the angle between them is not a right angle.
In right triangles, however, the two sides that are perpendicular can be a base and a height.
The area of this triangle is 18 square units whether we use 4 units or 9 units for the base.