Reputation: 773
I have the following html code:
<div class="formDiv">
<form id="searchForm">
<input type="text" name="weathersearch" placeholder="Search places">
</form>
</div>
With the following css, it looks like this
.formDiv {
background-color: red;
max-width: 400px;
margin-left: auto;
margin-right: auto;
}
I wish to have a larger search box, not a larger div. But targeting either the form id or the div gave me the same results, shown below. How would I make the form itself larger (i.e bigger horizontally and vertically).
#searchForm {
width: 300px;
height: 100px;
}
Upvotes: 0
Views: 79
Reputation: 4843
.formDiv {
background-color: red;
max-width: 400px;
margin-left: auto;
margin-right: auto;
width: 300px;
height: 100px;
}
#searchForm {
height: 100%;
width: 100%;
}
#frmInput {
height: 100%;
width: 100%;
}
<div class="formDiv">
<form id="searchForm">
<input type="text" id="frmInput" name="weathersearch" placeholder="Search places">
</form>
</div>
Upvotes: 0
Reputation: 15715
If you'd like to size the input element relative to .searchForm
or .formDiv
, do:
.searchForm input {
height: 100%;
}
Otherwise, just set the height on the input element directly:
.searchForm input {
height: 400px;
}
Upvotes: 3