I was following another stack overflow post link to put a search button inside of a search bar using flex-grow property. It works fine on Desktop (both chrome and safari)
It also looks fine in Mobile View of Chrome's developer tool, even mobile view of iPhoneSE:
However, it looks different on iPhone (both chrome and safari) especially the search button.
In addition, on iPhone SE, the search button is not inside of the search box.
Here is my code (html):
<div class='search'>
<form class='search-form' method="POST" action="{% url 'search_forum_market' %}">
{% csrf_token %}
<input id='search-bar' name="searchterm" type="text">
<input id='forum-button' type="submit" value="Search" name="_forum">
</form>
</div>
Here is my css:
.search {
grid-column: 2;
width: 500px;
max-width: 100%;
justify-self: center;
}
.search-form {
/* This bit sets up the horizontal layout */
display:flex;
flex-direction:row;
/* This bit draws the box around it */
border:2px solid grey;
border-radius: 15px 15px 15px 15px;
width: 100%;
max-width: 500px; /* added */
margin: 8px 0; /* added */
}
#search-bar {
/* Tell the input to use all the available space */
flex-grow:2;
/* And hide the input's outline, so the form looks like the outline */
border: white 1px;
font-size: 16px;
padding: 4px;
border-radius: 15px 0 0 15px;
}
#forum-button{
background: gray;
color: black;
font-size: 16px;
border-radius: 0px 10px 10px 0px;
border: gray solid 1px;
padding: 2px;
}
I could not figure out why this is happening. Thanks.