Magnetic flux can penetrate a type-II superconductor in the form of Abrikosov vortices (also called flux lines, flux tubes, or fluxons) each carrying a quantum of magnetic flux phi 0=h/2e. These tiny vortices of supercurrent tend to arrange themselves in a triangular flux-line lattice (FLL), which is more or less perturbed by material inhomogeneities that pin the flux lines, and in high-Tc superconductors (HTSCs) also by thermal fluctuations. Many properties of the FLL are well described by the phenomenological Ginzburg-Landau theory or by the electromagnetic London theory, which treats the vortex core as a singularity. In Nb alloys and HTSCs the FLL is very soft mainly because of the large magnetic penetration depth lambda . The shear modulus of the FLL is c66~1/ lambda 2, and the tilt modulus c44(k)~(1+k2 lambda 2)-1 is dispersive and becomes very small for short distortion wavelengths 2 pi /k<< lambda . This softness is enhanced further by the pronounced anisotropy and layered structure of HTSCs, which strongly increases the penetration depth for currents along the c axis of these (nearly uniaxial) crystals and may even cause a decoupling of two-dimensional vortex lattices in the Cu-O layers. Thermal fluctuations and softening may `melt` the FLL and cause thermally activated depinning of the flux lines or ofthe two-dimensional `pancake vortices` in the layers. Various phase transitions are predicted for the FLL in layered HTSCs. Although large pinning forces and high critical currents have been achieved, the small depinning energy so far prevents the application of HTSCs as conductors at high temperatures except in cases when the applied current and the surrounding magnetic field are small.