Home

Page 2 of 14 - 68 posts

  • 2021-08-01

    Move one flex item to the right

    Author

    Comments

    Start a discussion

    When using flex you often use justify-content or align-items to position the items where you want them.

    To make one flex item move to the right is really simple. You can to go back to basic and use margin-left: auto;.

    Read more
  • 2021-05-01

    List item span all the way

    Author

    Comments

    Start a discussion

    Here we have a list. It's not as straight forward as it seems to make the active list item be selected all the way to the left,

    The trick is to use a pseudo element that spans all the way out.

    Read more
  • 2021-04-01

    Invert icons on hover

    Author

    Comments

    Start a discussion

    Hover the icon below and it will be inverted to white. The trick is to use filter: invert(1);.

    HTML

    <figure>
      <img src="http://csspoo.com/assets/images/remixicons/link.svg">
    </figure>

    CSS

    figure {
      display: inline-block;
      padding: 1rem;
      background: #eee;
    }
    
    figure img {
      filter: invert(1);
      vertical-align: top;
    }
    
    figure:hover {
      background: #000;
    }
    
    figure:hover img {
      filter: invert(0);
    }
    Read more