Issue
I am making an app. And here I have an input box and a button. I want to center it. I tried using the center
tag, it did not work. I tried using align-items:center
still did not work. How to do this ??? Here is my program -
.form-inline {
display: flex;
flex-flow: row wrap;
align-items: center;
}
.form-inline label {
margin: 5px 10px 5px 0;
}
.form-inline input {
vertical-align: middle;
padding: 10px;
background: transparent;
border: 1px solid #ddd;
}
.form-inline button {
padding: 10px 20px;
background: transparent;
border-right: 1px solid #ddd;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
color: white;
cursor: pointer;
}
<form class="form-inline" action="/">
<input id="email" placeholder="Enter email" name="email" />
<button type="submit">Submit</button>
</form>
How to achieve this ??? Pls help
Solution
**justify-content: center;**
.form-inline {
display: flex;
flex-flow: row wrap;
align-items: center;
justify-content: center;
}
Answered By - Jaswinder Kaur
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.