The dependence of elastic moduli of shales on the mineralogy and microstructure of shales is important for the prediction of sweet spots and shale gas production. Based on 3D digital images of the microstructure of Longmaxi black shale samples using X-ray CT, we built detailed 3D digital images of cores with porosity properties and mineral contents. Next, we used finite-element (FE) methods to derive the elastic properties of the samples. The FE method can accurately model the shale mineralogy. Particular attention is paid to the derived elastic properties and their dependence on porosity and kerogen. The elastic moduli generally decrease with increasing porosity and kerogen, and there is a critical porosity (0.75) and kerogen content (ca. ≤3%) over which the elastic moduli decrease rapidly and slowly, respectively. The derived elastic moduli of gas- and oil-saturated digital cores differ little probably because of the low porosity (4.5%) of the Longmaxi black shale. Clearly, the numerical experiments demonstrated the feasibility of combining microstructure images of shale samples with elastic moduli calculations to predict shale properties.