Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS The Selectors Solution

Jesse Bayer
Jesse Bayer
Front End Web Development Techdegree Student 10,237 Points

For the border step

I used:

input[placeholder="Enter email..."]:focus { border: solid 3px blue; }

It worked the same way as the solution, I just want to make sure that this isn't a bad way of doing it.

2 Answers

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 90,824 Points

I don't think of it as a bad way of doing it. As long as it works well with any other pseudo styles that you're using, such as the background colour of the input field you're using. Does the style do the job effectively that the input field is in fact in keyboard focus? If that's true, it's a good style. :-)

Not really an issue in terms of functionality, however, in order to keep css easy to read, there are some methodologies like BEM and some others which ask for an order on the css file, and that would skip those methodologies.

Here is an article from CSS tricks on some proposals going around for CSS https://css-tricks.com/methods-organize-css/