While black pants and a blue shirt technically do not match, they are very often worn together. Mixing black and blue successfully depends mostly on the shade of blue chosen.
While a pale blue shirt tends not to work when worn with black pants, mixing darker colors of blue with black is very fashionable. Black and navy are both neutral colors, so they can be worn together stylishly. The combination looks professional and sophisticated and works equally well for daytime business wear and for day-to-evening outfits. When wearing a blue shirt with black pants, one should wear black shoes and belt to match the trousers.