Prompt Title: Style Placeholder in CSS.

Created 1 year ago
Votes 0
Views 224 times
IT
0

Prompt Detail:

To style the placeholder text of an input field in CSS, you can use the ::placeholder pseudo-element. You'll need to target different vendor prefixes for better cross-browser compatibility. Here's an example that demonstrates how to style the placeholder text:

css
/* For most modern browsers */ input::placeholder { color: #999; font-style: italic; font-size: 16px; } /* For WebKit browsers (e.g., Chrome, Safari, etc.) */ input::-webkit-input-placeholder { color: #999; font-style: italic; font-size: 16px; } /* For Mozilla Firefox */ input::-moz-placeholder { color: #999; font-style: italic; font-size: 16px; opacity: 1; /* Firefox uses opacity for placeholder, so set it to 1 to make it fully visible */ } /* For Microsoft Edge and Internet Explorer */ input:-ms-input-placeholder { color: #999; font-style: italic; font-size: 16px; } /* For Microsoft Edge */ input::-ms-input-placeholder { color: #999; font-style: italic; font-size: 16px; }

This example will style the placeholder text of an input field with a gray color, italic font style, and a font size of 16px. Adjust the properties according to your design preferences.

avatar
GorgDev
Shared 1 prompt
Created 1 year ago

Leave a Comment

Related Tag Prompts

113
0
HTML & CSS Hero
1 year ago 2023-02-03 13:01:47 AIPRM
0
0
0
0
0
0
em vs rem in CSS.
1 year ago 2023-03-16 20:05:20 Teona
0
0
Z-Index in CSS.
1 year ago 2023-03-18 10:30:51 aman
0
0
background-clip
1 year ago 2023-03-22 17:40:27 Codevhn
0
0
Adding CSS to HTML.
1 year ago 2023-04-07 09:53:50 Chetan Yadav
0
0
Ebook html
11 months ago 2023-04-21 05:07:11 darrat
0
0
Request for English Assistance.
11 months ago 2023-05-03 12:23:45 me
0
0
Vue Layout Creation.
11 months ago 2023-05-11 20:06:21 asif