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


i want flexbox if possible when on big screen 10 buttons on row.

when on middle screen 5 buttons on first row , 5 on second row. when on little screen 2 buttons per rows. , when on little screen 1 buttons per rows.

so want multiple of 10 because have 10 buttons don't want 8 buttons first row , 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>

you can use media queries can add these codes display 10 buttons in big screen

            @media (min-width: 1200px){                 input[type="submit"] {                   width:122px;                   float: left;                   font-size: 12px !important;                   padding: 1em 1em;                 }             } 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -