How can I change the height
and width
of the tag input
of type date and time, in HTML itself or CSS?
How can I change the height
and width
of the tag input
of type date and time, in HTML itself or CSS?
You can select the type of input
you want using attr
of direct CSS for type date
and type time
in this way.
In this example, in addition to width
, I put a bordar
to see how it only gets the style in the inputs with the type defined in attr
input[type="date"],
input[type="time"] {
width: 200px;
height: 30px;
border: 2px solid green;
}
<input type="date">
<input type="time">
<input type="text" placeholder="tipo text">
<input type="email" placeholder="tipo email">
You can add the style tag directly to your html tag, for example:
<input type="date" name="date" id="date" style="width:500px;height:500px;">
But it's not recommended and if I'm not mistaken it's not good practice.
Using CSS
:
<style type="text/css">
#date{width:500px;height:500px}
</style>
<input type="date" name="date" id="date">