skip to Main Content

I have an input form that’s meant to capture twitter handles. I simply want to center the input and submit buttons in the center of the page, but for some reason I can’t get it to work with me. Here’s the relevant snippet of CSS/HTML (also note, I’m using Bootstrap & ASP.NET)

<form asp-action="GetTwitterHandle">
    <div class="submitView">
        <input name="UserHandle" class="form-control" placeholder='&#64Example_User'/>
        <input type="submit" class="btn btn-primary" value="Get Stats" />
    </div>
</form>
.submitView {
    border: 1px solid orange;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50%;
}

2

Answers


  1. enter image description here

    If you want something like this… remove width: 50% and add height: 100vh;

    If it’s not helping, let me know by commenting.

    Login or Signup to reply.
  2. set height: 100vh; in the submitView class. it will align the item horizontally and vertically.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search