HTML / CSS - input date height width

3

How can I change the height and width of the tag input of type date and time, in HTML itself or CSS?

    
asked by anonymous 20.05.2018 / 15:59

3 answers

3

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">
    
20.05.2018 / 16:19
2

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.

    
20.05.2018 / 16:13
1

Using CSS :

<style type="text/css">
    #date{width:500px;height:500px}
</style>
<input type="date" name="date" id="date">
    
20.05.2018 / 16:04