The word “ukiyo” is a Japanese term that means “floating world”. This specific term refers to the time period between 1600 and 1867. This is a time period in Japan where the people wanted to seek pleasure. It mainly flourished in the city of Yoshiwara. Other cities did pick up the idea too - mainly Kyoto and Osaka. The idea of ukiyo was to seek pleasure and to live comfortably.
It flourished in Yoshiwara for two reasons. It’s the red-light district of Edo (which is now called Tokyo). This means it was the home of brothels and things of that nature. The second reason is that these brothels and other places were frequented by the growing middle class of the time period.