Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                
<h1>Brasil para gráfico em CSS</h1>
<p>Créditos para Julia de Belli (on Figma) - <a href="https://www.figma.com/file/ancNkrCa5NgragNA4d1VFj/%F0%9F%87%A7%F0%9F%87%B7-Brazil-in-pixels-for-data-vis">https://bit.ly/3wn9xrj</a>



<h2 class="titulo">
  Brasileirão vs. PIB Estadual
</h2>

<div id="legenda_b">
  <div class="titulo_legenda">62 EDIÇÕES</div>
  
  <div class="legenda-item">
    <div class="legenda-cor" style="background-color: #C0C0C0;"></div>
    <div class="legenda-texto">
      NÃO TEM
    </div>
  </div>

  <div class="legenda-item">
    <div class="legenda-cor" style="background-color: #C0C0C0; border: 3px solid #000000;width:26px;height:26px"><div class="sublegenda-cor">x</div></div>
    <div class="legenda-texto">
      TEM
      
    </div>
  </div>

  <div class="legenda-item">
  </div>

  <div class="titulo_legenda">PIB</div>
  
  <div class="legenda-item">
    <div class="legenda-cor" style="background-color: #FF4062;"></div>
    <div class="legenda-texto">
      > 2 TRI
    </div>
  </div>

  <div class="legenda-item">
    <div class="legenda-cor" style="background-color: #FF7F77;"></div>
    <div class="legenda-texto">
      > 600 BI
    </div>
  </div>

  <div class="legenda-item">
    <div class="legenda-cor" style="background-color: #FD9D2D;"></div>
    <div class="legenda-texto">
      > 300 BI
    </div>
  </div>
  <div class="titulo_legenda"></div>

  <div class="legenda-item">
    <div class="legenda-cor" style="background-color: #FFE500;"></div>
    <div class="legenda-texto">
      > 150 BI
    </div>
  </div>

  <div class="legenda-item">
    <div class="legenda-cor" style="background-color: #FEFFCB;"></div>
    <div class="legenda-texto">
      > 80 BI
    </div>
  </div>

  <div class="legenda-item">
    <div class="legenda-cor" style="background-color: #f1f1f1;"></div>
    <div class="legenda-texto">
      &lt; 80 BI
    </div>
  </div>


</div>

<div class="map">

  <div id="rr" class="estado" title="Roraima">RR</div>
  <div id="ac" class="estado" title="Acre">AC</div>
  <div id="ro" class="estado"title="Rondônia">RO</div>
  <div class="empty"></div>
  <div class="empty"></div>
  <div class="empty"></div>
  <div class="empty"></div>

  <div class="empty"></div>
  <div id="am_b" class="estado" title="Amazonas">AM</div>
  <div id="mt_b" class="estado" title="Mato Grosso">MT</div>
  <div id="df_b" class="estado" title="Distrito Federal">DF</div>
  <div id="ms_b" class="estado" title="Mato Grosso do Sul">MS</div>
  <div id="pr_b" class="estado" title="Paraná">PR
    <div class="sublegenda">2</div>
  </div>
  <div id="rs_b" class="estado" title="Rio Grande do Sul">RS
  <div class="sublegenda">5</div>
  </div>

  <div id="ap" class="estado" title="Amapá">AP</div>
  <div id="pa_b" class="estado" title="Pará">PA</div>
  <div id="to_b" class="estado" title="Tocantins">TO</div>
  <div id="go_b" class="estado" title="Goiás">GO</div>
  <div id="sp_b" class="estado" title="São Paulo">SP
  <div class="sublegenda">32</div></div>
  <div id="sc_b" class="estado" title="Santa Catarina">SC</div>
  <div class="empty"></div>

  <div class="empty"></div>
  <div id="ma_b" class="estado" title="Maranhão">MA</div>
  <div id="pi" class="estado" title="Piauí">PI</div>
  <div id="mg_b" class="estado" title="Minas Gerais">MG
    <div class="sublegenda">6</div>
    
  </div>
  <div id="rj_b" class="estado" title="Rio de Janeiro">RJ
  <div class="sublegenda">16</div></div>
  <div class="empty"></div>
  <div class="empty"></div>

  <div class="empty"></div>
  <div id="ce_b" class="estado" title="Ceará">CE</div>
  <div id="pe_b" class="estado" title="Pernambuco">
    PE
    <div class="sublegenda">1</div>
  </div>
  <div id="ba_b" class="estado" title="Bahia">BA
    <div class="sublegenda">2</div>
  </div>
  <div id="es_b" class="estado" title="Espírito Santo">ES</div>
  <div class="empty"></div>
  <div class="empty"></div>

  <div class="empty"></div>
  <div id="rn" class="estado" title="Rio Grande do Norte">RN</div>
  <div id="pb" class="estado" title="Paraíba">PB</div>
  <div id="al" class="estado" title="Alagoas">AL</div>
  <div id="se" class="estado" title="Sergipe">SE</div>

  <div class="empty"></div>
  <div class="empty"></div>


</div>

</div>


<h2 class="titulo">
  Estado de origem
</h2>
<div id="legenda">

  <div class="legenda-item">
    <div class="legenda-cor" style="background-color: yellow;"></div>
    <div class="legenda-texto">
      2
    </div>
  </div>

  <div class="legenda-item">
    <div class="legenda-cor" style="background-color: #ff0000;"></div>
    <div class="legenda-texto">
      5
    </div>
  </div>

  <div class="legenda-item">
    <div class="legenda-cor" style="background-color: #f5f5f5;"></div>
    <div class="legenda-texto">
      10 
    </div>
  </div>

  <div class="legenda-item">
    <div class="legenda-cor" style="background-color: green;"></div>
    <div class="legenda-texto">
      20
    </div>
  </div>

  <div class="legenda-item">
    <div class="legenda-cor" style="background-color: #f5f5f5;"></div>
    <div class="legenda-texto">
      50
    </div>
  </div>

  <div class="legenda-item">
    <div class="legenda-cor" style="background-color: #ff0000;"></div>
    <div class="legenda-texto">
      > 100
    </div>
  </div>


</div>

<div class="map">

  <div id="rr" class="estado">RR</div>
  <div id="ac" class="estado">AC</div>
  <div id="ro" class="estado">RO</div>
  <div class="empty"></div>
  <div class="empty"></div>
  <div class="empty"></div>
  <div class="empty"></div>

  <div class="empty"></div>
  <div id="am" class="estado">AM</div>
  <div id="mt" class="estado">MT</div>
  <div id="df" class="estado">DF</div>
  <div id="ms" class="estado">MS</div>
  <div id="pr" class="estado">PR</div>
  <div id="rs" class="estado">RS</div>

  <div id="ap" class="estado">AP</div>
  <div id="pa" class="estado">PA</div>
  <div id="to" class="estado">TO</div>
  <div id="go" class="estado">GO</div>
  <div id="sp" class="estado">SP</div>
  <div id="sc" class="estado">SC</div>
  <div class="empty"></div>

  <div class="empty"></div>
  <div id="ma" class="estado">MA</div>
  <div id="pi" class="estado">PI</div>
  <div id="mg" class="estado">MG</div>
  <div id="rj" class="estado">RJ</div>
  <div class="empty"></div>
  <div class="empty"></div>

  <div class="empty"></div>
  <div id="ce" class="estado">CE</div>
  <div id="pe" class="estado">PE</div>
  <div id="ba" class="estado">BA</div>
  <div id="es" class="estado">ES</div>
  <div class="empty"></div>
  <div class="empty"></div>

  <div class="empty"></div>
  <div id="rn" class="estado">RN</div>
  <div id="pb" class="estado">PB</div>
  <div id="al" class="estado">AL</div>
  <div id="se" class="estado">SE</div>

  <div class="empty"></div>
  <div class="empty"></div>


</div>

</div>

              
            
!

CSS

              
                /* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
  font-family: 'Montserrat','Roboto', sans-serif;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
  padding:50px;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}

.titulo {
  text-transform: uppercase;
  font-family: 'Montserrat','Roboto', sans-serif;
  font-size: 28px;
  line-height: 1.3em;
}


#legenda {
  margin-left: 250px;
  display: grid;
  grid: repeat(3, 36px) / auto-flow 150px;
  font-family: 'Montserrat','Roboto', sans-serif;
}


#legenda_b {
  margin-left: 250px;
  display: grid;
  grid: repeat(4, 36px) / auto-flow 150px;
  font-family: 'Montserrat','Roboto', sans-serif;
}

.titulo_legenda {
  margin-top: 7px;
  font-family: 'Montserrat';
  font-weight:600;
  font-size: 16px;
}


h1 {
  font-size: 3.5em;
}

p {
  margin-left:8px;
  margin-top:20px;
  margin-bottom:40px;
  
}

h2 {
  float: left;
  width: 150px;
  font-weight: 600;

}


.legenda-cor{
  float: left;
  width: 32px;
  height: 32px;
}

.legenda-texto {
  font-family: 'Montserrat','Roboto', sans-serif;
  margin-left: 44px;
  margin-top: 8px;
  font-weight: 600;
}

.sublegenda {
  float:right;
  margin-top:-18px;
  margin-right:2px;
  font-family: 'Roboto Mono', sans-serif;
  font-size:14px;
  font-weight:500;
}

.sublegenda-cor {
  float:right;
  margin-right:2px;
  font-family: 'Roboto Mono', sans-serif;
  font-size:14px;
  font-weight:500;
}

.map {
  padding: 5em;
  clear: both;
  display: grid;
  grid: repeat(7, 64px) / auto-flow 65px;
  font-family: 'Roboto Mono', sans-serif;
}

.estado {
  background-color: #f1f1f1;
  margin: .5px;
  align-content: center;
  text-align: center;
  padding-top: 35%;
  color: black;
  border: 1px solid #fff;

  font-size:18px;
  font-family: 'Roboto Mono', sans-serif;
  font-weight: 500;
}

.estado:hover {
    background-color: #ffffff !important;
    cursor: crosshair;
}

#am {
  background-color: #ff0000;
}

#to {
  background-color: yellow;
}

#pa {
  background-color: green;
}

#mg_b, #rj_b {
  background-color: #FF7F77;
  border: 3px solid #000000;
  padding-top: 31%;
}

#am_b, #ma_b, #mt_b, #ms_b, #es_b {
  background-color: #FEFFCB;
}

#pe_b {
  background-color: #FFE500;
  border: 3px solid #000000;
  padding-top: 31%;
}

#ce_b, #pa_b, #df_b, #go_b {
  background-color: #FFE500;
}

#sc_b{
  background-color: #FD9D2D;
}

#pr_b, #rs_b {
  background-color: #FD9D2D;
  border: 3px solid #000000;
  padding-top: 31%;
}

#sp_b {
  background-color: #FF4062;
  border: 3px solid #000000;
  padding-top: 31%;
}

#ba_b {
  background-color: #FFE500;
  border: 3px solid #000000;
  padding-top: 31%;
}










              
            
!

JS

              
                
              
            
!
999px

Console