CSS Secrets

CSS Secrets

  1. If you use class in HTML, then use "." in CSS

  2. if you use it in HTML then use "#" in CSS

  3. you can use Bootstrap or a font-awesome website for icons but type this link in HTML.

  4. . { padding:0; margin:0; } *UNIVERSAL STATEMENT

  5. text-decoration:none;//[for dismiss option of lining] }

  6. #yellow{ background-color :RGB(167, 219, 12);

  7. **[you can use (rgb or 6 digit character to select color)]

  8. border-radius:60%;

    ** [you can use it to curve the edges]

  9. height:50px; width:70%

    **[you can use percentage sign with respect to the previous ancestor]

  10. text-align: center;

  11. padding-top:40px;

    **[this property can use to increase/decrease size in content]

  12. margin-top:100px;

    **[this is used for distancing 2 contents]

  13. border:2px solid yellow;

  14. font-size:0.85rem;

    **[to set font-size]

  15. spinAnimate is the name of class @keyframes spinAnimate{ from{tansform:rotate(0deg);} to {transform:rotate(360deg);} }

    ** [for animate]

  16. @media (min-width:300px) and (max-width:400px){ div{ background-color: pink; }(phone, desktop,i-pad)

  17. #box2 { 20. position: relative/absolute/sticky/static};

    you can set the position of the boxes

  18. top:20px;

  19. left:10px;

  20. z-index: 3;

    **[if z-index is positive then it will come in front or if z-index is negative then it will occupy the space behind it]

  21. logo{ background-image:URL("amazon_logo.png"); height:50px; width:100px; background-size: cover; }

    YOU CAN SET BACKGROUND-IMAGE

  22. YOU CAN SET THE BORDER AND HOVER

    .border2 { border:2px solid transparent; } .border2:hover { border:2px solid orange; } .border:active { border:2px solid orange-red; }

    FOR FLEX BOX*

  23. { display: flex;

  24. flex-wrap: wrap;

  25. justify-content:flex-end/space-around/space-evenly/:center;

  26. flex-direction: row/row-reverse; }