5 Awesome CSS tricks

  1. Smooth scrolling:
    html {
    scroll-behavior: smooth;
    }
  2. Resize images to fit
    img {
    max-width:100%;
    height:auto;
    }
  3. : Setting an image as cursor
    body {
    cursor: url(“images/cursor.png”), auto;
    }
  4. Center anything in 3 lines of code
    .center {
      width: 300px;
      height: 300px;
      display: flex;
      justify-content: center;
      align-items: center;
    }
  5. Set a limited content in a paragraph
    p {
      -webkit-line-clamp: 5;
    }

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.