Thursday, 28 November 2019

how to display three items per row using CSS

3 elements per row for wrapping flexbox : css

Description:

In this example we explain that how to display three items per row using CSS.or how to display three items or three Checkboxes per row in Checkbox List using CSS.or how I can show three column per row that’s type of question was raised by many developers.

So in this scenario we have a requirement like Checkbox List contains 50 items and we have to display three items per row.

So to achieve this below is the code to display 3 items per row or per line using CSS.


Code:

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">


    <style type="text/css">
        .Maindv {
            display: flex;
            flex-wrap: wrap;
        }

        .childdv {
            flex: 1 0 21%; /* explanation below */
            margin: 5px;
            height: 100px;
            background-color: Red;
        }
    </style>
    <title>how to display three items per row using css</title>
</head>
<body>
    <form id="form1" runat="server">
        <div class="Maindv">
            <div class="childdv"></div>
            <div class="childdv"></div>
            <div class="childdv"></div>
            <div class="childdv"></div>
            <div class="childdv"></div>
            <div class="childdv"></div>
            <div class="childdv"></div>
            <div class="childdv"></div>
        </div>
    </form>
</body>
</html>

4 comments:

  1. https://aspsolutionkirit.blogspot.com/2019/11/how-to-display-three-items-per-row.html?showComment=1592743227908#c7000138689229470988

    ReplyDelete
  2. https://aspsolutionkirit.blogspot.com/2019/11/how-to-display-three-items-per-row.html?showComment=1592989002914#c7626321590809258063

    ReplyDelete