CHICAGO — Chicago teachers went on strike Thursday, marching on picket lines after failing to reach a contract deal with the nation’s third-largest school district in a dispute that canceled classes for more than 300,000 students.

The strike came after the Chicago Teachers Union confirmed Wednesday night that its 25,000 members would not return to their classrooms. It follows months of negotiations between the union and Chicago Public Schools that failed to resolve disputes over pay and benefits, class size and teacher preparation time.

Picketing teachers said Thursday the walkout was about getting more resources and smaller class sizes for students in the cash-strapped district, not about putting more money in their pockets.

Outside Smyth Elementary, a predominantly black and low-income school on the city’s near South Side, art teacher John Houlihan said “we’re not fighting for paychecks and health care. It’s the kids.”

“It’s ridiculous to say that you can put these kids who are dealing with profound poverty and profound homelessness in classes of 30-40 kids,” said Houlihan, who picketed with about 20 other teachers and staff as drivers passed by, honking their horns. “That’s not manageable and it is not an environment for learning.”

The strike is Chicago’s first major walkout by teachers since 2012 and city officials announced early Wednesday that all classes were canceled for Thursday in hopes of giving more planning time for parents.

Chicago Teachers Union President Jesse Sharkey joined teachers picketing outside Helen Peirce International Studies school, where he said every kindergarten class has at least 30 students. He said there’s “pent-up frustration” among union members about conditions in the schools and the union wants some of those longstanding issues addressed in their next contract.

“As of right now, as of this moment, we have still not seen those promises in writing,” Sharkey said. “That’s important and frankly it’s important what the words actually are. We don’t want a half measure, we want some of these basic conditions completely addressed.”

Mayor Lori Lightfoot said she was disappointed by the union’s decision to strike.

“We are offering a historic package on the core issues — salary, staffing and class size,” she said.

Lightfoot voiced frustration about what she sees as the union’s lack of urgency to make a deal.

“So, what we need is for the union to come back to the table to bargain in good faith, spend the time actually getting a deal done, face to face with us and not off to the side in a caucus,” she said. “If there is a seriousness of purpose and a willingness on the other side we could get a deal done today.”

During the 2012 strike, the district kept some schools open for half days during a seven-day walkout. District officials said this time they will keep all buildings open during school hours, staffed by principals and employees who usually work in administrative roles.

Breakfast and lunch will be served, but all after-school activities and school buses are suspended.

Janice Jackson, the district’s CEO, encouraged parents to send their children to the school that they normally attend, however they will be welcome in any district schools.

“We’ve put together a really comprehensive plan for the students,” Jackson said. “We will make sure they are safe and they have a productive day.”

Also striking are 7,000 support staffers, whose union also failed to reach a contract agreement.

At Thomas Chalmers Elementary School on the city’s west side on Thursday, about 25 teachers cheered and waved in response to cars and trucks honking in support, taking short breaks to replenish mugs full of hot coffee.

Maggie Sermont, a 32-year-old special education teacher, said Chalmers’ teachers also are concerned that a nurse, social worker and speech pathologist typically visit the school just once a week. Kids may see those specialty staff in group sessions that further limit their one-on-one time, she said.

“It just feels like we’re putting a Band-Aid over a bullet hole,” she said.

Samantha Williams, 24, said it’s “not good” that her first-grade son is missing instruction time. Williams said she understands teachers need more help but also expressed frustration and questioned the motives behind the walkout. “I think it’s more about money. I don’t think they had to go on strike.”

But Jamel Boyd, a 51-year old-chef, shouted her support to teachers as she dropped off her 10-year-old-son and 8-year-old daughter at Smyth Elementary and accepts the teachers’ explanation that the strike has less to do with getting the city to spend money on their salaries than it does spending money on improving schools.

“I am so with you all,” she yelled. She said the city needs to spend more money on schools so CPS can provide nurses and social workers, rather than investing in other projects, such as the city’s lakefront.

“Kids are coming with all kinds of problems, anxiety, homelessness and these teachers need help, classroom support,” said Boyd, who told of the day her son was rushed to a hospital by ambulance because there was no nurse at the school that day who she believes would have quickly recognized that the asthma attack staffers thought her son was having was actually a panic attack. “They need to stop beautifying Lake Shore Drive and do something for these people. Lake Shore Drive is beautiful enough.”

Negotiations between CPS and the union were scheduled to resume Thursday.