(CNN) -- It begins again with every new school year: A student heads to class with a certain T-shirt, a wild hairdo or a new pair or shorts and soon, the phone rings.
Principal G. A. Buie, from Eudora High School in Eudora, Kansas, thinks a lot of parents know what's coming.
"I can't tell you how many times I have called a parent and said, 'Hey, I just want to let you know that I've talked to your son or daughter today and their clothing is inappropriate' for one reason or the other, and the parent says, 'Well I told them when they left the house they were gonna get in trouble,' " Buie said.
School dress codes are nothing new, but from school to school, district to district, state to state, the guidelines are different, and changing. As students head back to school this fall, there will be the latest crop of students -- and parents -- challenging the rulebook.
In 2010, schools around the country banned bracelets that read "I heart boobies." The bracelets were made by nonprofit Keep a Breast Foundation as a light-hearted way to increase breast cancer awareness among young people. In Easton, Pennsylvania, two middle school students were suspended for wearing them, the ACLU of Pennsylvania said, because the school said they could be interpreted as lewd.
This month, a federal appeals court said a Pennsylvania school district couldn't enforce its ban on the bracelets -- they're protected speech because they show support for a national breast-cancer awareness campaign, and don't disrupt school activities.
No state legislatures or education departments mandate uniforms or specific dress codes, according to the Education Commission of the States, an organization that provides nonpartisan information about education policy for state leaders. Still, 21 states and the District of Columbia have passed policies that authorize districts or schools to require uniforms and other laws influence dress codes.
In 2011, Arkansas passed a law that requires districts to prohibit clothes that expose underwear, buttocks or female students' breasts. A California law requires schools allow students to wear hats while outdoors during the school day. Several states require districts to allow parents and staff to weigh in on what school uniforms should be.
"Student appearance, the courts said, can be regulated if it is vulgar, indecent, obscene, insulting or if it carries a message that encourages inappropriate behavior," according to the Education Commission of the States.
School policies are typically regulated by community standards, said Buie, the president-elect of the National Association of Secondary School Principals. Policies that some might see as overly conservative, or even antiquated, can stay on the books for a long time. The old rules don't always work when large school systems grow, combining multiple communities into one district, Buie said, or as families move around, bringing new ideas about what's normal or appropriate.
In some cases, the rules are updated to suit changing norms.
'It wasn't offensive'
Last year, 5-year-old Cooper Barton was told to turn his University of Michigan T-shirt inside-out because it violated school rules. The dress code in Oklahoma City's public schools said students may only wear shirts from Oklahoma colleges and universities. The 2005 policy was put into place to deter gang activity.
"He was a little embarrassed," his mother, Shannon Barton, told CNN affiliate KWTV. "It wasn't offensive. You know, he's 5."
The Oklahoma City school board changed its dress code as a result of the Barton's complaints, KWTV reported, and the Barton family was gifted with tickets to a Michigan football game.
In almost any school, there are a few things that are likely to guarantee a student a trip to the principal's office, Buie said. Most schools ban clothes that advertise drugs and alcohol, Buie said. Shirts bearing an Einstein anti-war quote and the NRA logo and a machine gun have gotten students in trouble in recent years.
But often times, it's not the crazy shirt, outrageous hairdo or visible tattoo that gets a student in trouble, Buie said. Rather, it's that they don't change the behavior they've been asked to correct.
"I've never been around a school that didn't give a student the opportunity to put on a shirt that's appropriate," he said.
An attitude of defiance and "What are they going to do to me, anyway?" is what leads to trouble.
"They know the policies, they know the rules, but they choose to do it anyway," Buie said.
'A singular goal -- to create a safe environment'
The American Civil Liberties Union says the Supreme Court has affirmed students' rights to express their opinions, as long as they don't "materially and substantially" disrupt classes or other school activities. But it warns on its website that it won't always win a dress code debate: "If you think your school's dress codes and hair codes are unfair and you want to challenge them, be aware that a court probably won't overturn the codes unless the judge finds that they're really unreasonable, or that they're discriminatory."
Many school districts say dress codes are a matter of order and safety -- and nobody is exempt.
In 2011 in Fremont, Nebraska, sixth-grader Elizabeth Carey was told she couldn't wear her rosary to school because it violated the school's dress code. She said it was an expression of her faith. Steve Sexton, Fremont's superintendent of schools, said local gangs were using rosaries as a symbol of gang affiliation.
"There are those who want to make this an issue about religion when it's about a singular goal -- to create a safe environment for our students," Sexton told CNN affiliate KETV.
Her parents said they were floored. Elizabeth said she wouldn't stop wearing the cross in necklaces or on her clothes.
Wouldn't any parent be upset about their child being punished for wearing a rosary, or dying his hair pink in support of breast cancer research?
Buie said there are plenty of times when a call home to parents results in the recitation of the First Amendment. It's a relatively new challenge for educators, he said.
"Now we have parents that are more likely to support and defend their children as being the ones that are correct," he said. "If we've done something wrong, (parents) are going to come to us and let us know that we need to change or look at doing something differently --15, 20 years ago, that wasn't the case."
Explaining the dress code and why a child was told to change, leave school or even face suspension doesn't stop parents from being offended when their kids are punished, Buie said, or from glaring when he sees them at the grocery store.
While students have the right to free speech, it's the school's job to teach children that they can't infringe on someone else's rights, he said.
"Those are things that are taught in schools," he said, "accepting differences."
CNN's Jamie Gumbrecht contributed to this report.