Annabeth Mellon said the sexual education lessons she received at her rural Alabama middle school were inadequate at best.

“They separated men and women in two different rooms,” she told NBC News. “If we discussed with someone from the opposite sex what we saw, we would be suspended. I thought, ‘What could they possibly be showing the boys that I couldn’t know about?’”

Annabeth Mellon at the Advocates for Youth Urban Retreat 2017, Washington D.C. Lloyd Wolf

Mellon, now 19 and openly bisexual, said those sex-ed classes — which made no mention of LGBTQ people or same-sex sexual activity — did not provide her with much useful information. And, she added, they reinforced the notion that sex — especially non-heterosexual sex — was something dirty, something one shouldn’t talk about.

“There was a rule in our dress code that you couldn’t wear anything that implied gay pride, because it was so controversial,” she said. “I never had a teacher say being gay is wrong, but I was in an environment where I understood if people knew this awful thing about me, I wouldn’t be safe.”

Alabama, where Mellon attended school, is one of seven states with so-called "no promo homo" laws, education laws that explicitly prohibit the positive portrayal of homosexuality in schools.

The laws, which are currently in effect in Alabama, Texas, Arizona, South Carolina, Oklahoma, Louisiana and Mississippi (Utah repealed its law last year), affect millions of public school students annually and can have various negative effects on LGBTQ youth, according to a recent report by GLSEN, an LGBTQ education advocacy group.

In 7 states, “no promo homo” laws prohibit educators from “promoting homosexuality” – and they hurt #LGBTQ students. Our latest research: https://t.co/RGFlNfDt0h pic.twitter.com/04tBRNRE2T — GLSEN (@GLSEN) January 30, 2018

The report found even after accounting for several variables, such as state differences in demographics, education spending and political attitudes, LGBTQ students in states with laws that prohibit the “promotion of homosexuality” were less likely to find peers that are accepting of LGBTQ people, more likely to hear homophobic remarks and more likely to face harassment and assault at school based on their sexual orientation and gender expression.

The report also found schools in these seven states are less likely to have teachers and administrators who are supportive of LGBTQ students, less likely to have supportive resources (like Gay-Straight Alliance clubs) and less likely to have LGBTQ-inclusive health services.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The exact laws differ in each state, but advocates say they all function to further stigmatize lesbian, gay, bisexual, transgender and queer students.

In Alabama, for instance, the law states that “any program or curriculum in the public schools in Alabama that includes sex education or the human reproductive process shall, as a minimum, include and emphasize … in a factual manner and from a public health perspective, that homosexuality is not a lifestyle acceptable to the general public and that homosexual conduct is a criminal offense under the laws of the state.”

South Carolina’s law mandates health education “may not include a discussion of alternate sexual lifestyles from heterosexual relationships including, but not limited to, homosexual relationships except in the context of instruction concerning sexually transmitted diseases.”

The report notes that school staff who are not educated on the parameters of the law in their state may avoid including LGBTQ topics in courses outside of sexual health education as well for fear of violating the law.

Debra Hauser, president of Advocates for Youth, an organization that seeks to provide youth with “honest sexual health information,” said these so-called “no promo homo” laws are nothing more than state-institutionalized homophobia..

“They are an attempt to, at best ignore, and at worst to completely stigmatize young people who identify as LGBTQ,” she told NBC News. “It completely says to young people, ‘It’s OK to bully and discriminate, because the state says it’s OK.’”

Hauser speculated that many of these laws are rooted in fear and stigma of HIV.

“If you remember the height of the HIV epidemic, HIV transmission and the gay community were closely associated,” she said. “My guess is some of this was driven or reinforced during that time.”

Indeed, most of these laws, according to LGBTQ advocacy group Lambda Legal, were passed in the late 1980’s and early 1990’s, at the height of the HIV/AIDS epidemic.

While groups like GLSEN and Lambda Legal are advocating for the repeal of these laws, others are pushing to uphold them. Focus on the Family, a conservative Christian organization that has long opposed LGBTQ rights, maintains a “True Tolerance” website that condemns the “disturbing trend of schools introducing lessons to kids about things like homosexuality, transgenderism or same-sex marriage.” The site offers a variety of resources for parents, including “7 Ways Parents Can Respond to Homosexual Advocacy in Schools.”

When asked for the organization’s official stance on education laws that prohibit the positive portrayal of homosexuality, Candi Cushman, an education analyst at Focus on the Family, said “school policies should demonstrate respect for all students and families who are part of the school system — including those with religious beliefs."

“Policies should offer both across-the-board protection for every student, as well as respect for the fact that parents have the most intimate knowledge of their children, and therefore, should have the power to decide when, if and how their kids are introduced to controversial sexual topics,” Cushman told NBC News via email.

Annabeth Mellon, now a women’s studies major at the University of Alabama, is trying to change perceptions about what issues are considered “controversial sex topics.”

While her early sex-ed classes did not include LGBTQ-inclusive lessons, Mellon said she’ll never forget the joy and shock of first hearing LGBTQ-affirming words in a classroom. When she was a high school freshman at the Alabama School of Fine Arts in Birmingham, a sex-ed guest lecturer stood up in front of the class and said matter-of-factly, “Some people are queer.”

“It blew my mind,” Mellon said, adding that she said she wants every young person in Alabama to have a similar experience.

Last year, a House bill to repeal Alabama’s law prohibiting mention of homosexuality in sex education died in committee, but Mellon said she’s not giving up and will continue to push for LGBTQ-inclusive sex-ed in her state.

“Queer people exist in the rural South,” she said. “The rest of the world wants to forget about that fact, because we’re a ‘lost cause,’ but that thinking is what allows ‘no promo homo’ laws to remain in existence.”

FOLLOW NBC OUT ON TWITTER, FACEBOOK AND INSTAGRAM