U.S. stocks rose again Tuesday, this time getting some help from a sector that has lagged behind in the postelection rally: technology.

The Dow Jones Industrial Average hit yet another record, rising 54.37 points, or 0.3%, to 18923.06. Tech stocks rose 1.3% in the S&P 500, paring their losses since Election Day to 1.8%.

Tech companies in the...