Use of crack cocaine has declined among high school seniors for the first time because of changing attitudes and increased knowledge about the drug's harmful effects, a survey said Tuesday.

The 1988 National High School Senior Survey, conducted by The University of Michigan's Institute for Social Research, found use of all drugs generally declined among students in high school and college.Even alcohol use dropped for the first time in several years. "Current drinkers" - seniors who had one or more drinks in the past 30 days - declined from 66 percent to 64 percent, while students who had five or more drinks in a row during the prior two weeks declined from 38 percent to 35 percent, down from a high point of 41 percent in 1983.

But the study's director, Lloyd Johnston, said the drop in the use of crack - a potent, smokeable derivative of cocaine - is "one of the most important findings" of the survey of some 16,000-17,000 seniors in 135 high schools nationwide.

The survey also uses a representative sample of about 1,200 American college students and a national sample of about 11,000 young adults one to 11 years beyond high school.

The latest survey funded by the National Institute on Drug Abuse, an arm of the Department of Health and Human Services, showed that 4.8 percent of all seniors between 1987 and 1988 reported ever using crack, compared with 5.6 percent in the previous year. Annual use of crack fell from 4 percent to 3.1 percent, after having leveled off between 1986 and 1987.

Other key findings: Marijuana use continued its long-term, gradual decline with about a third of all high school seniors reporting some use of the drug. In 1979 almost half reported some use. Cocaine use dropped between 1986 and 1988 from 13 percent to 8 percent, following a six-year period of fairly level use.