There are many options as to what kind of investment property you should buy, from houses to apartments to just land. Each has its advantages, and each has its disadvantages.
The land is the part that really does all the heavy lifting in terms of price rises. The building on the land, will actually depreciate in the short term to medium term. However in the long long run even building costs are subject to inflation.
Buying a house with some land is ideal.
Apartments obviously have the smallest part of land if any so in a lot of areas you are paying mainly for the structure. At the other extreme bare land/sections carry their own risk. During tough economic times values can drop quite a bit. as development drops out of fashion. Plus it can be tough to maintain the mortgage on bare land especially if no option for cash flow exists.
The overall take away is that a structure is needed for cash flow, but the land is needed for strong gains in value.