jeudi 23 février 2017

How to make flexbox boxes as choosable checkboxes?

I have a flexbox row with boxes that looks like this.

enter image description here

How to make it as options? So when you click on one of them, you check checkbox and the chosen box is highlighted.

<ul class="flex-container longhand">
  <li class="flex-item">1</li>
  <li class="flex-item">2</li>
  <li class="flex-item">3</li>
  <li class="flex-item">4</li>
  <li class="flex-item">5</li>
</ul>

CSS

.flex-container {
  padding: 0;
  margin: 0;
  list-style: none;
  display: flex;
}

.longhand {
  flex-flow: wrap row;
}

.flex-item {
  color: #C3D0D9;
  border: 1px solid #C3D0D9;
  width: 50px;
  height: 50px;
  font-size: 1.3em;
  text-align: center;
  padding: 10px;
}




Aucun commentaire:

Enregistrer un commentaire