"An elegant dress."
Translation:Un vestido elegante.
Well, when it comes to the words gender, logic usually just don't work and they need to be learnt by heart. But there are also some general patterns, for example most of the words ending with -o are masculine - un vaso, un camino, un campo... and un vestido as well.
vestido MASCULINE NOUN 1. (clothing) dress a. dress "Fue a París para comprar su vestido de novia. She went to Paris to buy her wedding dress." 2. (garments) a. clothes "El vestido cambió mucho a través de los siglos. Clothes have changed a lot over the centuries." ADJECTIVE 3. (clothed) a. dressed "¡Qué bien vestido estás hoy! You're dressed so nicely today!"
The gender of words in Spanish don't necessarily relate to how we perceive them: dresses aren't inherently feminine, anyway. Silla uses "la," and we don't think of chairs as feminine, do we? It's just how the word is, and usually has to do with how it ends- which again, doesn't necessarily depend on gender. For people, endings matter, but objects are set.
Here are a couple of articles on the topic of gender in Spanish that you may find helpful.
Gender of Nouns in Spanish https://www.thoughtco.com/gender-inherent-characteristic-of-spanish-nouns-3079266
Masculine and Feminine Nouns https://www.spanishdict.com/guide/masculine-and-feminine-nouns
FULL DISCLOSURE: Native English speaker - US, Southern Appalachian dialect. Other uses of English may vary. Advice about Spanish should be taken with a grain of salt.