(CBS SF) — The city of Pleasanton is among the top U.S. cities rated for family-friendliness, according to a real estate website.

The annual ranking of more than 500 U.S. cities was compiled by Apartment List. The website based its rankings on four criteria: safety as determined by FBI data on violent crime; housing affordability, taking into account area income and rental prices; education quality as determined by graduation rates; and child friendliness, gleaned as a percentage of population under age 18.

READ MORE: Newsom Unveils State's COVID Recovery Plan Fueled By Unprecedented $75.7B Budget Surplus

Pleasanton was the top-ranked Bay Area city, ranking 18th in overall family-friendliness, followed closely by Palo Alto, Fremont and San Ramon.

Palo Alto was determined to have high housing affordability despite its elevated real estate and rental prices, which are somewhat offset by the city’s high median household income of $136,000, according to the U.S. Census Bureau.

Sunnyvale, South San Francisco, Alameda and Daly City were other Bay Area cities that made the top 100 out of 510 cities ranked.

READ MORE: Bonta Among 44 Attorneys General Telling Facebook To Drop Instagram For Kids Proposal

At the opposite end of the family-friendly scale, Vallejo was nearly at the bottom with a rank of 507 while Oakland was ranked at 503.

Apartment List designated Flower Mound, Texas, as the top family-friendly city in the U.S. Flower Mound is just north of Dallas-Fort Worth. Nearby Frisco was ranked as the second-most family-friendly.

Thousand Oaks in Ventura County was the top-rated California city.

MORE NEWS: Pedestrian Killed In Hit-and-Run Collision On El Camino Real in Redwood City