locked
Display in Centre RRS feed

  • Question

  • User-797751191 posted

    Hi

      In below code i want to display Save in centre

    <div class="row">
    <div class="form-group col-md-12">
    <asp:Button ID="btnSave" runat="server" class="btn btn-primary" Text="Save" OnClick="btnSave_Click"/>

    </div>
    </div>

    Thanks

    Monday, June 24, 2019 7:53 AM

All replies

  • User-719153870 posted

    Hi jsshivalik,

    If you want to center the Save button relative to the outer div, you can use ‘text-align: center’ in CSS.

    Please refer to below codes:

    <head runat="server">
        <title></title>
        <style type="text/css">
            .col-md-12 {
                text-align:center;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
            <div class="row">
                <div class="form-group col-md-12">
                    <asp:Button ID="btnSave" runat="server" class="btn btn-primary" Text="Save"  />
                </div>
            </div>
        </form>
    </body>

    Here is result of my demo:

    Best Regard,

    Yang Shen

    Monday, June 24, 2019 8:35 AM
  • User-797751191 posted

    Hi Yang

      I want size should also be col-md-4

    Thanks

    Monday, June 24, 2019 4:42 PM
  • User-719153870 posted

    Hi jsshivalik,

    I'm sorry that i can't understand your question. Whose size do you want to change, or do you want to add a div with its class="col-md-4"?

    If so, please refer to below codes:

    <head runat="server">
        <link href="Content/bootstrap.min.css" rel="stylesheet" />
        <title></title>
        <style type="text/css">
            .col-md-12 {
                text-align: center;
                width:100%;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
            <div class="row">
                <div class="form-group col-md-12">
                    <div class="form-group col-md-4">
                    <asp:Button ID="btnSave" runat="server" class="btn btn-primary" Text="Save" />
                        </div>
                </div>
            </div>
        </form>
    </body>

    Notice: You can check the style by selecting it, right-clicking on 'Go To Definition' and entering bootstrap. min. CSS to see the details of the style. And in your page, you can override this style.

    Here's result of my demo:

    Best Regard,

    Yang Shen

    Tuesday, June 25, 2019 1:34 AM
  • User-857013053 posted

    <div class="row">
    <div class="form-group col-md-12">
    <asp:Button ID="btnSave" runat="server" class="btn btn-primary" Text="Save" OnClick="btnSave_Click" style="text-align:center"/>
    </div>
    </div>

    Thursday, June 27, 2019 4:11 AM
  • User-1151440187 posted

    <div class="row">
    <div class="form-group col-md-12">
    <asp:Button ID="btnSave" runat="server" class="btn btn-primary center" Text="Save" OnClick="btnSave_Click"/>

    </div>
    </div>

    <style>

    .center{

    text-align:center;

    }

    </style>

    Monday, September 9, 2019 4:43 AM
  • User-1151440187 posted

    <div class="row">
    <div class="form-group col-md-12">
    <asp:Button ID="btnSave" runat="server" class="btn btn-primary center" Text="Save" OnClick="btnSave_Click"/>

    </div>
    </div>

    <style>

    .center{

    text-align:center;

    }

    </style>

    Monday, September 9, 2019 4:46 AM