Template:Composition bar: Difference between revisions
SGPolitico (talk | contribs) No edit summary |
SGPolitico (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<div style="width: 100%; background-color: #e6e6e6; border: 1px solid #ccc; height: | <div style="width: 100%; background-color: #e6e6e6; border: 1px solid #ccc; height: 20px; position: relative; box-sizing: border-box; overflow: hidden; display: flex; align-items: center;"> | ||
<div style="width: {{{1}}}%; background-color: {{#switch: {{{party|}}} | <div style="width: calc(min(100%, {{{1}}}%)); background-color: {{#switch: {{{party|}}} | ||
| PAP = #2b58ab | | PAP = #2b58ab | ||
| WP = #5a99fe | | WP = #5a99fe | ||
Line 9: | Line 9: | ||
| default = #cccccc | | default = #cccccc | ||
}}; height: 100%;"></div> | }}; height: 100%;"></div> | ||
<span style="position: absolute | <span style="position: absolute; left: 50%; transform: translateX(-50%); font-size: 12px; color: #000; white-space: nowrap;">{{{1}}}%</span> | ||
</div> | </div> |