Welcome Coders

! Here is a every thing which is you want !

! Cheatsheet of every coding language is available on this website !


CSS Cheatsheet

  1. Syntax
    selector{
    property: value;
    property2: value2;
    }
                        
  2. Include external css file
    <link rel="stylesheet" type="text/css" href="/style.css" />
                        
  3. Internal styles
    
                        
  4. Inline styles
    .clearfix:after {
    clear: both;
    content: " ";
    display: block;
    font-size: 0;
    height: 0;
    visibility: hidden;
    }
    .clearfix { display: inline-block; }
    * html .clearfix { height: 1%; }
    .clearfix { display: block; }
                        
  5. Selectors
    div            all div tags
    div,p          all divs and paragraphs
    div p           paragraphs inside divs
    div < pall p tags,             one level deep in div
    div + p           p tags immediately after div
    div ~p            p tags preceded by div
    .classname      all elements with class
    #idname         element with ID
    div.classname             divs with certain classname
    div #idname             div with certain ID
    #idname*          all elements inside #idname
                        
  6. Media Queries
    @media not|only mediatype and (media feature) {
    CSS Code }
    Link external file:
    <link rel="stylesheet" media=mediatype and|not|only (media feature href="mystylesheet.css">
                        
  7. Viewport is 480 pixels or smaller
    @media screen and (max-width: 480px) { }
                        
  8. Viewport width smaller OR height smaller
    @media screen and (max-width: 600px), (max-height: 500px) {}
                        
  9. Print style
     @media print { ... }
                        
  10. Night / dark mode
    @media (prefers-color-scheme: dark) { ... }
                        
  11. Media types
    all, print, screen, speech
                        
  12. To seat background img
    background: url();
                        
  13. To seat background colour
    background-color: ;
                        
  14. To set border
    border: 2px solid black;
                        
  15. Box model