A jump in technology shares pushed some major indexes higher Tuesday, putting the S&P 500 within striking distance of a new all-time high.

The broad benchmark index ticked up 0.1% shortly after the opening bell. The Nasdaq Composite rose 0.7%, pointing to a third consecutive day of gains for the index of technology and growth stocks.

The Dow Jones Industrial Average slipped, losing about 55 points, or 0.2%. On Monday, the blue-chip index briefly climbed into record territory before ending the session down 0.4%.

Stocks have been range bound in recent sessions, with indexes hovering close to record levels due to a rapidly rebounding U.S. economy and significant levels of support from Washington and the Federal Reserve. The market’s moves in recent weeks have moderated amid inflation concerns. Investors say they are settling in for a period of choppy trading while they await fresh clues on whether a sharp rise in consumer prices will prove to be fleeting.

“There will be constant gut checks from both the bond and the stock markets on whether this is transitory, or is turning into permanently higher inflation,” said David Donabedian, chief investment officer at CIBC Private Wealth Management. “I would still put the odds of a higher S&P 500 at the end of the year as better than 50%, but I think there will be more volatility than return to be had in the second half of the year.”

In corporate news, Tesla rose 1.7% after data from the China Passenger Car Association showed sales of electric cars in China surged by 177% in May. The electric car maker sold over 33,000 vehicles that were made in China last month.

Shares of Clover Health Investments soared 44% after the healthcare company emerged as the latest darling for retail traders on Reddit forums, building on its 32% gain Monday. Other so-called meme stocks like GameStop and AMC Entertainment Holdings climbed more than 3% each.

Coupa Software dropped 7.4% after the company said it expected to post a loss in its 2022 fiscal year. Marvell Technology rose 6.3% after the chip maker posted record quarterly sales.

In bond markets, the yield on the benchmark 10-year U.S. Treasury note fell to 1.533%, from 1.570% Monday. Bond yields drop when prices climb. While worries about a sharp and sustained spike in inflation have abated somewhat, money managers are continuing to assess whether it may erode the returns from fixed-income assets.

“You are beginning to see data which suggest that while elevated inflation might be transitory, the time horizon implied by the word ‘transitory’ is getting longer,” Mr. Donabedian said. “If the inflation data is going to persist on the high side for the next six to nine months, then the Fed is going to have to clarify what it means by transitory.”

Bitcoin prices continued to fall, hovering close to their lowest level since late January. The cryptocurrency fell 4.8% from its 5 p.m. ET level Monday to about $32,815, according to CoinDesk.

Overseas, the pan-continental Stoxx Europe 600 rose 0.4%, putting it on course to close at a fresh all-time high.

In Asia, stock indexes mostly edged lower by the close of trading. Japan’s Nikkei 225 slid 0.2%. In Hong Kong, the Hang Seng Index was relatively unchanged from the prior day. China’s Shanghai Composite Index fell 0.5%.

—Caitlin McCabe contributed to this article.

NYSE employees eating lunch outside the New York Stock Exchange on Monday.

NYSE employees eating lunch outside the New York Stock Exchange on Monday.

Photo: Richard Drew/Associated Press

Write to Will Horner at William.Horner@wsj.com