Reputation: 3615
Can someone explain how I can modify the second input id shown below so that it is not visible on the page and also does not take up any space on the page?
<section>
<label for="muni">Municipality</label>
<div>
<input id="county_select" type="text" />
<input id="county_no" type="text" value="" disabled="disabled" style="visibility:hidden" />
</div>
</section>
Currently, this second input id takes up space on my form and I don't want it to take up any space. Thank you.
Upvotes: 2
Views: 5083
Reputation:
You can style the input using CSS, targeting it via its id
tag.
In your .css
file:
#county_no
{
display: none;
}
Styling HTML inline should be avoided.
Upvotes: 1
Reputation: 942
Use the style="display:none;"
instead of visibility:hidden
visibility:hidden
leaves space.
Upvotes: 3
Reputation: 253318
Use display: none;
, as shown:
<input id="county_no" type="text" value="" disabled="disabled" style="display: none;" />
Reference:
Upvotes: 9