Written by Lorelei Marfil, CNN

Royal Ascot is one of the world's most prestigious horse races and a highlight of the British summer social season. Each June, more than 300,000 visitors travel to the five-day event -- among them Queen Elizabeth and other members of the royal family, including Prince Charles, the Duke and Duchess of Cambridge and the Duke and Duchess of Sussex.

According to Elisabeth Murray, a fashion and textiles curator at the Victoria and Albert Museum in London, it's the royal presence that sets the tone for Ascot's famously strict standard of dress. (Think long skirts for women and waistcoats for men.) Guests of the Royal Enclosure, where the most formal dress is required, as well as more flexible areas, don their best "in respect of the event and its history," she explained in an email.

A painting by Arthur Hopkins (c.1890) of the enclosure at Ascot in Berkshire before the Gold Cup horserace. Credit: Hulton Archive/Getty Images

But what has been deemed Ascot appropriate has changed tremendously since 1711, when horse aficionado Queen Anne first founded the annual race. The fashions on show serve as a cultural barometer, reflecting an era's trends and social norms, and an ever-evolving dress code.

"Royal Ascot provides a needed space in fashion for the marrying of tradition and eccentricity," Murray said. "In the future, it will continue to adapt and evolve as it has since the first race in 1711, responding and reflecting society and fashion, and showcasing British style."

It was Beau Brummell, a Regency dandy and close friend of the future King George IV, who implemented Ascot's first dress code. In 1807, he decreed that "men of elegance" should wear waisted black coats with white cravats and pantaloons. However, Brummell left no guidance for the elegant women in attendance. Instead, their Ascot choices were to be guided by less tangible forces.

Attendees wear all black at to Royal Ascot in 1910, our of respect for the passing of King Edward VII. Credit: W. G. Phillips/Hulton Archive/Getty Images

In the 1800s, the standard was set by Queen Victoria, whose influence was such that when she wore a white wedding dress to marry Prince Albert in 1840, she sparked a tradition that is still followed around the world today. According to Ascot Racecourse, the organizing body behind Royal Ascot, the Queen set a vogue for porter bonnet (a headpiece that shielded the face from observers) when she wore one to Ascot in the 1830s.

The royal influence was also felt in 1910, the year of the famed "Black Ascot." As the royal family mourned the death of King Edward VII, guests wore all black out of respect.

After World War One, Ascot became a showcase for the trends taking hold on both sides of the Atlantic. This meant shorter hemlines, pearls and furs in the 1920s, and the nipped-waists and A-line skirts of Christian Dior's New Look in the 1950s. (Queen Elizabeth and Princess Margaret were both fans of the silhouette, and the latter wore a cream dress by the designer to Ascot in 1952.)

While their male companion looks traditionally formal, the ladies embraced more carefree silhouettes at the 1922 Royal Ascot -- despite the rain. Credit: Topical Press Agency/Hulton Archive/Getty Images

While it was long known that there were certain expectations around what to wear Ascot, it was only in 2012 that the event organizers released a formal style guide for racegoers, outlining dress code regulations for the Royal Enclosure and the Queen Anne Enclosure to help racegoers to dress appropriately for the occasion.

The strictest rules are reserved for the invitation-only Royal Enclosure, which was initially established as a private space for guests of King George III in 1807. Here, men are advised to wear black or gray morning dress (a formal suit comprising a coat with tails, a waistcoat and trousers, accessorized with a tie), along with a plain black or gray top hat. Women's hemlines must fall just above the knee or lower, and straps on dresses or tops should be at least one inch wide. (Off-the-shoulder Bardot necklines were banned in 2018.) Hats are mandatory, and there are strict rules around the base size of headpieces.

Queen Elizabeth II, dressed in black with a white hat, followed by Princess Margaret at the the second day of Royal Ascot in 1952. Credit: AP

"Institutions such as Ascot and the (Henley) Royal Regatta have gradually evolved their dress codes over the years to reflect changes in society and fashion," said Rupert Wesson, academy director at Debrett's, the leading authority on British etiquette, in an email.

"However, they have been careful to do so in ways that do not detract from the sense of occasion. There is still a need to dress up!"

Indeed, it's in this spirit of keeping with the times that Royal Ascot made the move to allow trouser suits for women in the 1970s, and jumpsuits as of 2017. According to Juliet Slot, chief commercial officer of Ascot Racecourse, fashion has become an inextricable part of the Royal Ascot experience, and organizers is always open to adapting the dress code to reflect certain trends.

A woman wears a trouser suit and jacket at Royal Ascot in 1970. Credit: Evening Standard/Hulton Archive/Getty Images

"What the future holds depends on how fashion evolves over the coming years and how this influences cultural changes. We are always recognizing and assessing new styles and look to integrate them into the annual Royal Ascot Style Guide, if suitable for a formal summer occasion," she wrote in an email.

"We welcome the ever-evolving nature of fashion and encourage our customers to interpret new styles in a way that adheres to the royal meeting's famous dress code."