0

I am trying to centre an asp button in the very centre of a div. I have managed to centre the button horizontally and vertically, but not at the same time. I have been through several other similar questions yet none of the solutions work for me.

        <div class="container" style="border: solid red 1px;">
        <div class="row">
            <span class="col-md-3 Suggestions">Feel free to send any suggestions to the site</span>
            <asp:TextBox ID="Suggestions" CssClass="Suggestions col-md-7 suggestionsBox" runat="server">Enter your suggestions here</asp:TextBox>
            <div class="text-center col-md-2 suggestionsSubmitParent">
                <asp:Button runat="server" CssClass="suggestionsSubmit" Text="Submit" ID="btnSubmit" />
            </div>
        </div>
        <div class="row">
            <span class="col-md-3 suggestionsName">Please enter your name</span>
            <asp:TextBox ID="SuggestionsName" CssClass="col-md-7 suggestionsName" runat="server">Enter your suggestions here</asp:TextBox>

        </div>
    </div>

CSS

.Suggestions {
    text-align:center;
    margin-top: 15px;   
}

.suggestionsBox {
    height: 140px;
}
.suggestionsName{
    margin-top:10px;
}

.suggestionsSubmit {
    width: 80px;
}
.suggestionsSubmitParent {
    height: 155px;
    display: flex;
    align-items: center;

1 Answers1

0

Add justify-content:center; to your .suggestionsSubmitParent css class.

Kosh
  • 16,966
  • 2
  • 19
  • 34