HTML5 날짜 입력 필드 클릭 시 달력 표시
데스크톱 전용
<hr>
기본 날짜 입력 필드 - 아이콘 클릭
일반적으로 HTML5 날짜 입력 필드(input date)를 사용할 경우, 달력 팝업을 표시하려면 아이콘을 클릭해야 합니다.
<input type="date">
입력 필드의 아무 곳이나 클릭하여 팝업 표시
<input type="date">
<style>
input[type="date"].field-enhance::-webkit-calendar-picker-indicator {
background: transparent;
bottom: 0;
color: transparent;
cursor: pointer;
height: auto;
left: 0;
position: absolute;
right: 0;
top: 0;
width: auto;
}
</style>
입력 필드를 클릭했을 때 달력 팝업을 표시하려면 아래 코드를 사용하세요:
<pre data-lang="CSS"><code>.input-container input {
border: none;
box-sizing: border-box;
outline: 0;
padding: .75rem;
position: relative;
width: 100%;
}
input[type="date"]::-webkit-calendar-picker-indicator {
background: transparent;
bottom: 0;
color: transparent;
cursor: pointer;
height: auto;
left: 0;
position: absolute;
right: 0;
top: 0;
width: auto;
}</code></pre>