mardi 12 septembre 2017

How can I align X item on first row and X item for the next row in flexbox?

I just want with flexbox if possible when I am on a big screen 10 Buttons on a row.

When I am on a middle screen 5 Buttons on first row and 5 on second row. When I am on a little screen 2 Buttons per rows. and when i am on a very little screen 1 Buttons per rows.

So I just want a multiple of 10 because I have 10 buttons but I don't want something like 8 Buttons first row and 2 Buttons second row.

body,
html {
  margin: 0;
  background: whitesmoke;
}

h1 {
  text-align: center;
  font-family: cursive;
}

#content {
  margin: 2px;
}

.toolbar>div {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
}

#contain {
  background: #EEEEEE;
  overflow-y: auto;
}

#marginTop {
  margin-top: 15px;
}

#onglets {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}

input:hover,
select:hover {
  border: 1px solid #B829fA;
}

input:focus {
  border: 1px solid #B829BA;
}

select:focus {
  border: 1px solid #B829ff;
}

input[type="submit"] {
  width: 150px;
  float: left;
  text-decoration: none;
  color: black;
  font-family: "Trebuchet MS";
  font-size: 14px;
  border-radius: 4px;
  transition: 0.25s;
  background: rgb(250, 250, 252);
  border: 1px solid #ccc;
  font: inherit;
  line-height: 1;
  margin: 0.5em;
  padding: 1em 2em;
  cursor: pointer;
  /*box-shadow: 0px 1px 3px #ccc;*/
}

input[type="submit"]:hover {
  background: white!important;
  color: white!important;
  box-shadow: inset 0 0 0 2em #B829fA!important;
  border: 1px solid white!important;
  text-decoration: underline;
}

input[type="submit"]:focus {
  background: white;
  color: white;
  box-shadow: inset 0 0 0 2em #B829fA;
  border: 1px solid white;
}

input[type="submit"]:focusout {
  background: white;
  color: white;
  box-shadow: inset 0 0 0 100% #B829BA;
  border: 1px solid white;
}

.inputContent {
  min-height: 19px;
}

.contents {
  visibility: hidden;
  display: none;
}

.border {
  border: 1px solid #ccc;
  padding: 1px;
  padding-left: 3px;
  padding-right: 3px;
  margin: 2px;
}

.block {
  padding: 5px;
  border: 1px solid #ccc;
  margin-bottom: 15px;
  margin-right: 15px;
  box-shadow: /*inset*/
  0px 1px 3px #ccc;
  border-radius: 4px;
  background: rgb(250, 250, 252);
  width: 100%;
  box-sizing: border-box;
}

.block:hover {
  border: 1px solid #B829FA;
}

.data,
.divValue {
  display: flex;
  justify-content: space-between;
  padding-bottom: 1px;
  padding-top: 1px;
  flex-wrap: nowrap;
  width: 100%;
}

.container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-around;
}

.subcontainer {
  display: flex;
  flex-direction: column;
  height: auto;
  width: 400px;
  justify-content: flex-start;
}

.spanCenter {
  display: flex;
  justify-content: flex-start;
  color: #B829BA;
  text-decoration: bold;
  padding-bottom: 5px;
  padding-top: 5px;
  margin-bottom: 5px;
}

.widthContain {
  width: 196px;
}
<!DOCTYPE html>
<html>

<body>
  <div id="onglets">
    <!--Menu-->
    <input id="inputGeneral" class="buttonMenu" type="submit" value="General">
    <input id="inputConditionement" class="buttonMenu" type="submit" value="Conditionement">
    <input id="inputMesure" class="buttonMenu" type="submit" value="Mesure">
    <input id="inputMat" class="buttonMenu" type="submit" value="Mat. Dangereuse">
    <input id="inputAlgorithme" class="buttonMenu" type="submit" value="Algorithme">
    <input id="inputPicking" class="buttonMenu" type="submit" value="Picking">
    <input id="inputCode" class="buttonMenu" type="submit" value="Code Barre">
    <input id="inputImage" class="buttonMenu" type="submit" value="Image">
    <input id="inputInventaire" class="buttonMenu" type="submit" value="Inventaire Tournant">
    <input id="inputChamps" class="buttonMenu" type="submit" value="Champs Libres">
  </div>
</body>

</html>



Aucun commentaire:

Enregistrer un commentaire