<div class="legend" style="direction:ltr;line-height:23px;"><div class="legend-content" style="display:inline-block;vertical-align:top;box-sizing:border-box;width:34px;height:23px;overflow:hidden;font-size:15px;border:thin solid #333;background: #DB2017;color:#202122;text-align:center;" title="#DB2017"> </div> PT: 6 seats</div><div class="legend" style="direction:ltr;line-height:23px;"><div class="legend-content" style="display:inline-block;vertical-align:top;box-sizing:border-box;width:34px;height:23px;overflow:hidden;font-size:15px;border:thin solid #333;background: #C0311A;color:#202122;text-align:center;" title="#C0311A"> </div> MORENA: 35 seats</div><div class="legend" style="direction:ltr;line-height:23px;"><div class="legend-content" style="display:inline-block;vertical-align:top;box-sizing:border-box;width:34px;height:23px;overflow:hidden;font-size:15px;border:thin solid #333;background: #FFCD00;color:#202122;text-align:center;" title="#FFCD00"> </div> PRD: 55 seats</div><div class="legend" style="direction:ltr;line-height:23px;"><div class="legend-content" style="display:inline-block;vertical-align:top;box-sizing:border-box;width:34px;height:23px;overflow:hidden;font-size:15px;border:thin solid #333;background: #F18130;color:#202122;text-align:center;" title="#F18130"> </div> MC: 25 seats</div><div class="legend" style="direction:ltr;line-height:23px;"><div class="legend-content" style="display:inline-block;vertical-align:top;box-sizing:border-box;width:34px;height:23px;overflow:hidden;font-size:15px;border:thin solid #333;background: #4DA663;color:#202122;text-align:center;" title="#4DA663"> </div> PRI: 203 seats</div><div class="legend" style="direction:ltr;line-height:23px;"><div class="legend-content" style="display:inline-block;vertical-align:top;box-sizing:border-box;width:34px;height:23px;overflow:hidden;font-size:15px;border:thin solid #333;background: #9AC95E;color:#202122;text-align:center;" title="#9AC95E"> </div> PVEM: 47 seats</div><div class="legend" style="direction:ltr;line-height:23px;"><div class="legend-content" style="display:inline-block;vertical-align:top;box-sizing:border-box;width:34px;height:23px;overflow:hidden;font-size:15px;border:thin solid #333;background: #C3C3C3;color:#202122;text-align:center;" title="#C3C3C3"> </div> Independientes: 1 seat</div><div class="legend" style="direction:ltr;line-height:23px;"><div class="legend-content" style="display:inline-block;vertical-align:top;box-sizing:border-box;width:34px;height:23px;overflow:hidden;font-size:15px;border:thin solid #333;background: #05338D;color:#202122;text-align:center;" title="#05338D"> </div> PAN: 109 seats</div><div class="legend" style="direction:ltr;line-height:23px;"><div class="legend-content" style="display:inline-block;vertical-align:top;box-sizing:border-box;width:34px;height:23px;overflow:hidden;font-size:15px;border:thin solid #333;background: #0AA;color:#202122;text-align:center;" title="#0AA"> </div> PANAL: 11 seats</div><div class="legend" style="direction:ltr;line-height:23px;"><div class="legend-content" style="display:inline-block;vertical-align:top;box-sizing:border-box;width:34px;height:23px;overflow:hidden;font-size:15px;border:thin solid #333;background: #6E2F7D;color:#202122;text-align:center;" title="#6E2F7D"> </div> PES: 8 seats</div>
Own work  using: <a class="external text" href="https://tools.wmflabs.org/parliamentdiagram/parliamentinputform.html">Parliament diagram tool</a>