Topic: Placeholder Style for Date Input
atomgregg pro asked 8 years ago
Hello,
I've having trouble getting the placeholders for the date input control to look the same as they do for the text input controls.
Even when I set the CSS color to something crazy like green the color remains a light grey. I want it to appear the same slightly darker grey as the input controls display, otherwise it looks half-arsed when I have some controls in one hue, and the date controls in another.
HTML
<div class="md-form input-group">
<input type="text" class="form-control search" placeholder="Search Like" style="width: 300px;">
<input type="date" id="news-date-from" class="datepicker" placeholder="After" style="width: 125px;">
<input type="date" id="news-date-to" class="datepicker" placeholder="Before" style="width: 125px;">
<span class="input-group-btn">
<a class="btn" ng-click="search()"><i class="fa fa-search"></i></a>
<a class="btn" ng-click="add()"><i class="fa fa-plus"></i></a>
</span>
</div>
Thanks,
Aaron
Add comment
Bartłomiej Malanowski staff answered 8 years ago
Try this code:
.datepicker::-webkit-input-placeholder { /* WebKit, Blink, Edge */
color: #00C851;
}
.datepicker:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: #00C851;
opacity: 1;
}
.datepicker::-moz-placeholder { /* Mozilla Firefox 19+ */
color: #00C851;
opacity: 1;
}
.datepicker:-ms-input-placeholder { /* Internet Explorer 10-11 */
color: #00C851;
}
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Specification of the issue
- ForumUser: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No