css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv
CodePen probably won't work great in this browser. We generally only support the major desktop browsers like Chrome, Firefox, Safari, and Edge. Use this one at your own risk! If you're looking to test things, try looking at Pens/Projects in Debug View.
user profile image

An input highlight inspired by Tripadvisor (https://www.tripadvisor.com/)


  1. You do not need a span Element for this: https://codepen.io/zothynine/pen/bYqeGO

  2. @zothynine without this span element he couldn't be able to implement border-color change on focus.

  3. Actually, it can be implemented without span keeping the focus state as in the example above. If you want to implement it only with the single input element and the pseudo element on the container as @zothynine did, for the focus state you can use new pseudo-class :focus-within (Edge & IE lack support). With this pseudo class you could do something like this:

    .input-wrapper:focus-within::after { 
      border-bottom-color: blue; 
  4. Same thing just using VueJS and :focus-within


  5. For my own benefit I forked your thing and rewrote it in Vue :) https://codepen.io/NielsOeltjen/pen/WXzzdb/

Leave a Comment Markdown supported. Click @usernames to add to comment.

You must be logged in to comment.