A few years ago, when the economy was more buoyant and liberals were still riding high, it was easy to tell the Democrats from the Republicans on tax issues.

Most Democrats had a simple creed: tax relief should go mainly to low- and middle-income households at the expense of the better-off. Business tax cuts were "giveaways." And Congress in the name of reform ought to close those "loopholes" that benefited the rich.

Republicans, on the other hand, wanted tax cuts skewed to help high-income investors, more tax cuts for business, an end to mounting budget deficits and "loopholes" left intact. Only a few Democrats -- all conservative southerners -- went along.

Today, however, as the House Ways and Means Committee moves into mark-up on a new tax-cut bill, the Democrats are a lot more conservative and the tax stances of the two major parties have shifted sufficiently to make old hands do a double-take:

The Democrats are still pushing a plan that would do more for those in the lower brackets than would the Republicans' tax package. But the Democratic alternative also contains so many breaks for savings and investment it is virtually a clone of the GOP proposals of a few years ago.

The Democrats are now proposing slashing the maximum rate on investment income from 70 to 50 percent; cutting estate and gift taxes; increasing savings incentives and write-offs on interest income; and even cutting capital gains taxes.

All would have been anathema to them even a few years ago.

At the same time, Republicans are pressing for large tax cuts that would send the budget deficit soaring -- a strategy they are fond of comparing to the tax-reductions pushed through by former President Kennedy in 1962.

Meanwhile, almost nobody is talking about loophole-closing or "tax reform."

Said House Majority Leader James C. Wright Jr. (D-Tex.) in a television interview recently: "One man's loophole is another man's legitimate benefit." Not long ago, that was the sort of thing only Republicans used to say.

You don't have to be the House majority leader to see there's been a real sea-change in thinking on tax issues in the past few years, both in Congress and among voters across the nation.

Although Democrats and Republicans are still scrapping furiously, the terms of debate have shifted so sharply that by historical standards the Republicans effectively will have won the battle even if they "lose" the current debate.

Conservatives, naturally, are delighted by the new tide.

Indeed, the Reagan administration thinks so much of the Democrats' proposals it had planned to incorporate them in a second tax-cut bill later on. Now it has concluded them in the president's new "bipartisan compromise" bill.

Treasury Secretary Donald T. Regan gleefully told reporters recently the president was "surprised" to hear the Democrats propose cutting the top rate on investment income to 50 percent, from the present 70 percent.

Of course, the president said he would go along, Regan added.

"It used to be that these kinds of things were only being advocated by rednecks and Republicans," chuckles Rep. Ken Holland (D-S.C.), another longtime Ways and Means member.

To Rep. Barber B. Conable (R-N.Y.), the committee's ranking Republican, the shift was almost inevitable. "It's obvious that what we were doing before just wasn't working," he says. "The whole American political system has moved."

What made the Democrats edge so far to the right?

"Inflation," says Rep. Sam Gibbons (D-Fla.), who was one of the early "tax reformers" on the Ways and Means Committee and now has turned more conservative himself.

What Gibbons has in mind is the impact of the price spiral in making the middle class feel more pinched -- and less charitable -- on questions of taxes.

In the early 1960s, when inflation still was mild, people were in a charitable mood. Tilting tax breaks to the poor was easy enough for Congress to do.

With the advent of soaring inflation, however, people have been earning more money than they ever dreamed, but enjoying it less -- making them far less inclined to sacrifice their tax relief to the poor.

Experts also cite these and other influences:

The recent round of business slumps, particularly in autos and steel, which has scared blue-collar workers and made them more willing to support business tax incentives that could ultimately mean more jobs.

The defeat -- or retirement -- of many older-line Democrats who provided the majority for previous tax cuts.

The emergence of an effective business lobby that has been able to unite on key tax issues, enabling it to push faster depreciation writeoffs and other corporate cuts successfully.

Today, Democrats and Republicans are falling all over each other to sponsor pro-business tax cuts. Even liberals on the Ways and Means Committee have a business tax-cut plan.

The zeal of "tax reformers" -- both in the last major "reform" bill, in 1976, and informer President Carter's ill-fated 1978 tax-revision proposal -- which finally cloyed and helped take the momentum out of loophole-closing.

The high-point of the "tax reform" movement came in 1976, when Congress passed a bill that seemed an embodiment of liberals' dreams.

The measure contained more than 200 separate "loophole-closings," shut down dozens of longstanding tax shelters, put new restrictions on use of the foreign tax credit and cut back tax breaks for Americans working abroad.

It also raised taxes of those who sell inherited property for profit, toughened the tax treatment of capital gains and trimmed back some of the tax breaks then given large farms.

But many of the provisions only led to heightened opposition. The tax increase on Americans working abroad, for example, left U.S. construction firms claiming they could not compete with foreigners because of increased costs.

Other 1976 changes, including the increased tax on sale of inherited assets, contained technical errors that later gave opponents a lever to use in overturning them. In early 1977, the lawmakers began undoing what they had enacted. Today, many of these provisions have been reversed.

The cause of "tax reform" may also have been set back by the complex overhaul plan Jimmy Carter sent to Congress in 1978 -- a plan so unrealistic in some respects that many feel that it made tax-revision look silly.

A prime example was Carter's loudly proclaimed demand that Congress cut back the longstanding deduction for business entertainment -- the so-called "three-martini lunch" -- a standard write-off in business for years.

Although the president asserted repeatedly that the deduction was a sop for corporate executives, the biggest opposition to ending it came from restaurant workers, who feared it would cost them jobs.

Even proposals aimed at the rich have bumped into roadblocks:

For years, liberals had been calling for increased taxes on capital gains -- profits from sale of stocks and other assets -- arguing that this kind of income should be taxed as heavily as wages. It is taxed less than half as heavily now.

Carter even toyed with a capital gains tax increase in 1977. But business interests marshaled thousands of ordinary investors, and the lawmakers wound up slashing capital gains taxes instead.

As one longtime tax-watcher once observed, there's a Horatio Alger notion embedded deeply in the public psyche: "People keep hoping that someday they'll strike it rich. And if they ever do, they want to be able to keep it."

Although it may seem abrupt, the change mood on taxes didn't occur overnight.

The tax-cut bill of 1978 marked a major departure from the longstanding help-the-poor philosophy.

Previous tax cuts had angled more of the relief to lower-income groups. But in 1978, the lawmakers for the first time cut taxes proportionally -- the same for all income brackets -- allowing middle- and upper-income groups more of a break than in the past.

Congress edged further rightward in 1979 and 1980 when conservative Democrats, led by Sen. Lloyd Bentsen (D-Tex.), began to embrace new tax proposals designed to spur "capital formation."

Rep. James R. Jones (D-Okla.), now chairman of the House Budget Committee, gained early prominence with a proposal -- co-sponsored by the GOP's Conable -- to provide faster depreciation writeoffs for business.

The Conable-Jones plan proved so popular that Reagan last year adopted it as the business side of his current tax-cut proposal. Reagan also wants to cut taxes for individuals by 25 percent over the next three years.

A further rightward movement came in mid-1980, when Senate Democrats were panicked by Reagan's advocacy of his tax-cut plan and hammered out one of their own -- laden with GOP-style investment incentives.

Although the Senate measure never actually was passed, it was revived last March by House Ways and Means Committee chairman Dan Rostenkowski (D-Ill.) -- and is almost certain to be in any tax bill Congress enacts this year.

Today, the entire debate is visibly farther to the right than it was a few years ago. President Reagan has proposed cutting tax rates the same percent for all -- a plan that mainly would benefit upper-income taxpayers.

Meanwhile, Sam Gibbons is still holding the fort for the Ways and Means Committee's Democrats: along with other Democrats, he's insisting any tax cuts be tilted to the little man -- the family making under $50,000 a year.