5 CSS Trick Nobody Tells You

 5 CSS Trick Nobody Tells You


Following are the 5 CSS Trick Nobody Tells You.

1. Smooth Scrolling With one line of CSS code


        html {
            scroll-behavior:smooth;
        }


2. Set the image as a cursor with one line of code


    .container {
          cursor: url(img.png), auto;
    }



3. Center anything in 3 lines of code


    .container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    }



4. Set limited content in a paragraph


        p {
        -webkit-line-clamp: 3;
        }
       

-Web-line-clamp CSS property allows limiting the content of a block container to the specified number of lines.

5. Add shadow to transparent image

 
    .container img {
        filter: drop-shadow(2px 2px 4px 8px #565656);
      }

     




Reactions

Post a Comment

0 Comments