Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAshley Elson
Front End Web Development Techdegree Student 5,972 PointsHow would I add the "Required" text inside of the input field?
I have tried adding the " content: "Required"; " property but it does not seem to show. Does anyone have an idea?
I have tried to do HTML -
<input type="text" name="name" id="user_name">
CSS -
input[type=text]::after {
content: "REQUIRED";
color: red;
}
But this does not work.
1 Answer
Ashley Elson
Front End Web Development Techdegree Student 5,972 PointsI have found out the answer.
The way I found out is ::placeholder
. You can style the placeholder with this pseudo-class which is excellent
Mario de Wolf
4,272 PointsMario de Wolf
4,272 Points<input type="text" id="name" name="usrname" required>
hope this works for you.
greetings,
Mario