A high school in Texas apologized to parents after a dress code video singled out female students in what many perceived as an act of sexism.

Marcus High School in Flower Mound created a video to reinforce dress code expectations but the video only showed girls walking around the halls wearing shorts and being reprimanded for the clothing.

The video was first shown to students last Thursday during a class advisory period known as "Maurader time," in which students discuss policies or work on character building.

The girls are shown walking through the halls before a teacher confronts them as a group and escorts them to a classroom with a sign that reads "dress code violators."

The girls were then seen in the video sitting in a classroom reciting text written on the whiteboard in unison: "I will not wear shorts."

Senior Catherine Moring first posted the video last Thursday on Twitter and the clip has since been viewed more than 270,000 times.

"Today my school was shown this video,” Moring wrote on Twitter. “So sad how ONLY girls are shown as the violators. I understand why my school has a dress code, but what about the boys who wear shorts, or show their shoulders? It’s 2018...Why are we still over-sexualizing teen girls?"

Moring, who obtained the video from a teacher, told ABC News that when she first watched the video, she immediately felt it was "blatant sexism."

"The first thing that came to mind was the blatant sexism and lack of diversity,” she said. “Not only were there no boys but there were no people of color, plus-sized individuals or people that identify as gender non-binary; all people who wear athletic shorts.”

The school is "pretty diverse," she said, which is why she was surprised at the narrow perspective that singled out only a small portion of the student body.

"My issue was never the fact that my school wanted us to have a dress code,” she said. “My issue was the fact that nobody in administration or the student body involved was able to see this video before they showed it to everyone, and recognize that this shouldn’t be shown.”

But despite the controversy, Moring said, she is "hopeful" after seeing the reactions on social media.

"I never did this with the intention that it would gain national attention,” she said. “Seeing people from around the globe interact and agree with me on Twitter has made me so hopeful for the future.”

Principal Will Skelton, who is in his first year in the role, did not immediately respond to ABC News' request for comment.

Skelton issued a letter apologizing to Marcus High School parents the day after the video was shown and explained that the video was made in lieu of an orientation fashion show to demonstrate proper dress code. The video "absolutely missed the mark," he said.

"I’m a firm believer that when you make a mistake, you own it, you apologize, and you make it right," Skelton wrote. "Please accept my sincere apology for not ensuring our video achieved its intended purpose — to remind ALL students of our dress code expectations."

Full letter from Marcus High School principal Will Skelton:

Aug. 17, 2018

Marcus Parents,

I apologized to our students regarding this issue today, but wanted to reach out and apologize to parents as well. I’m a firm believer that when you make a mistake, you own it, you apologize, and you make it right.

Yesterday we showed a dress code video that featured only female dress code violations, and was accompanied by a poor song choice. Construction in and around the campus prevented us from holding student orientation, which is typically accompanied by a fashion show that demonstrates what to wear, and what not to wear. We believed a video would be a good way to replace the fashion show, but this video absolutely missed the mark.

Please accept my sincere apology for not ensuring our video achieved its intended purpose — to remind ALL students of our dress code expectations.

If you want to visit with me about this or any other concern you may have, my door is always open.

Sincerely,

Will SkeltonPrincipal, Marcus High School