HTML

  1. HTML Starting code
  2. <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>
    <body>
        
    </body>
    </html>
  3. Heading 1
  4. <h1>Heading</h1>
  5. Heading 2
  6. <h2>Heading</h2>
  7. Heading 3
  8. <h3>Heading</h3>
  9. Heading 4
  10. <h4>Heading</h4>
  11. Heading 5
  12. <h5>Heading</h5>
  13. Heading 6
  14. <h6>Heading</h6>
  15. Div
  16. <div>Div</div>
  17. Paragraph
  18. <p>Paragraph</p>
  19. Span
  20. <span>Span</span>
  21. Bold
  22. <b>Bold</b>
  23. Strong
  24. <strong>Strong</strong>
  25. Italic
  26. <i>Italic</i>
  27. Em
  28. <em>Emphasized text</em>
  29. Small
  30. <small>Small</small>
  31. Big
  32. <big>Big</big>
  33. Subscript
  34. <sub>Subscript</sub>
  35. Superscript
  36. <sup>Superscript</sup>
  37. Img
  38. <img src="imgname_png" alt="">
  39. Pre
  40. <pre>Hello,everyone</pre>
  41. Ordered List
  42. <ol>
       <li>Ordered list</li>
       <li>Ordered list</li>
       <li>Ordered list</li>
       <li>Ordered list</li>
    </ol>
  43. Unordered List
  44. <ul>
        <li>Unordered list</li>
        <li>Unordered list</li>
        <li>Unordered list</li>
        <li>Unordered list</li>
    </ul>
  45. Table
  46. <table>
    <caption>Table</caption>
    <thead>
    <tr>
    <th>Column</th>
    <th colspan="2">Column2</th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td>Data</td>
    <td>Data</td>
    <td>Data</td>
    </tr>
    <tr>
    <td>Data</td>
    <td>Data</td>
    <td>Data</td>
    </tr>
    </tbody>
    <tfoot>
    <tr>
    <td> </td>
    <td>Data</td>
    <td>Data</td>
    </tr>
    </tfoot>
    </table>
  47. Form
  48. 
    <form action="/action.php" method="post">
        Name: <input name="name" type="text" /> <br />
        Age: <input max="80" min="1" name="age" step="1" type="number" value="18" /> <br />
        <select name="gender">
        <option selected="selected" value="male">Male</option>
        <option value="female">Female</option>
        </select><br />
        <input checked="checked" name="newsletter" type="radio" value="daily" /> Daily <input name="newsletter"
        type="radio" value="weekly" /> Weekly<br />
        <textarea cols="20" name="comments" rows="5">Comment</textarea><br />
        <label><input name="terms" type="checkbox" value="tandc" />Accept terms</label> <br />
        <input type="submit" value="Submit" />
    </form>
  49. Article
  50. <article>This is article</article>
  51. Section
  52. <section>This is section</section>
  53. Links
  54. <link rel="stylesheet" href="style.css">
    <script src="script.js"></script>
  55. Marquee
  56. <marquee behavior="scroll" direction="left">Hello</marquee>

CSS

  1. Universal Selector
  2. *{
     margin:0;
     padding:0;
     box-sizing:border-box;
    }
  3. Font-size
  4. font-size: 16px;
  5. Font-weight
  6. font-weight: 500;
  7. Font-family
  8. font-family: 'Courier New', Courier, monospace;
  9. Display-none
  10. display: none;
  11. Display-flex
  12. display: flex;
  13. Display-block
  14. display: block;
  15. Flex-direction-row
  16. flex-direction: row;
  17. Flex-direction-column
  18. flex-direction: column;
  19. Text-transform
  20. text-transform: uppercase;
  21. Line-height
  22. line-height: 80px;
  23. Text-Align
  24. text-align: center;
  25. Justify-Content
  26. justify-content: center;
  27. Align-Items
  28. align-items: center;
  29. Letter-spacing
  30. letter-spacing: 0.3rem;
  31. Word-spacing
  32. word-spacing: 2px;
  33. Color
  34. color: red;
  35. Background
  36. background: black;
  37. Background-color
  38. background-color: yellow;
  39. Background-size
  40. background-size: cover;
  41. Background-repeat
  42. background-repeat: no-repeat;
  43. Background-Image
  44. background-image: url('bg.png');
  45. Box-shadow
  46. box-shadow: 3px 4px 4px rgb(65, 63, 63);
  47. Max-width
  48. max-width: 991px;
  49. Max-height
  50. max-height: 888px;
  51. Min-width
  52. min-width: 300px;
  53. Min-height
  54. min-height: 200px;
  55. Overflow-hidden
  56. overflow: hidden;
  57. Overflow-auto
  58. overflow: auto;
  59. Overflow-scroll
  60. overflow: scroll;
  61. Visibility
  62. visibility: hidden;
  63. Opacity
  64. opacity: 3;
  65. Text-decoration
  66. text-decoration: none;
  67. List-style
  68. list-style: none;
  69. Position-absolute
  70. position: absolute;
  71. Position-relative
  72. position: relative;
  73. Position-fixed
  74. position: fixed;
  75. Position-sticky
  76. position: sticky;
  77. Border
  78. border: 2px solid black;
  79. Border-radius
  80. border-radius: 50%;
  81. Border-color
  82. border-color: red;
  83. Border-collapse
  84. border-collapse: seperate;
  85. Float-right
  86. float: right;
  87. Float-left
  88. float: left;
  89. Height
  90. height: 100vh;
  91. Width
  92. width: 100vh;
  93. Left
  94. left: 50%;
  95. Top
  96. top: 50%;
  97. Right
  98. right: 50%;
  99. Bottom
  100. bottom: 50%;
  101. Margin
  102. margin: 0 0 0 0;
  103. Padding
  104. padding: 0 0 0 0;
  105. Margin-top
  106. margin-top: 0px;
  107. Margin-bottom
  108. margin-bottom: 0px;
  109. Margin-left
  110. margin-left: 0px;
  111. Margin-right
  112. margin-right: 0px;
  113. Padding-top
  114. padding-top: 0px;
  115. Padding-bottom
  116. padding-bottom: 0px;
  117. Padding-left
  118. padding-left: 0px;
  119. Padding-right
  120. padding-right: 0px;
  121. Z-index
  122. z-index: -1;
  123. Center everything of webpage
  124. body{
     height: 100vh;
     display: flex;
     align-items: center;
     justify-Content: center;
    }
                    

JAVASCRIPT

  1. Function
  2. function functionName(){
     //your code goes here
    }
  3. GetElementById
  4. document.getElementById('idname');
  5. GetElementByClassName
  6. document.getElementByClassName('classname');
  7. GetElementByTagName
  8. document.getElementByTagName('tagname');
  9. QuerySelector
  10. document.querySelector('name');
  11. Create Element
  12. document.createElement('p');
  13. CreateTextNode
  14. document.createTextNode('your text');
  15. Console
  16. console.log('hello');
  17. If statement
  18. if(condition){
    //this code executed if the condition is true
    }
  19. If-else statement
  20. if(condition1){
    //this code executed if the condition is true
    }
    else{
    //this code executed if the condition1 is false
    }
  21. Else-if
  22. if(condition){
    //this code executed if the condition is true
    }
    else if(condition2){
    //this code executed if the condition1 is false
    }
    else{
    //this code executed if the condition1 and 2 is false
    }
    
  23. Switch statement
  24. switch(expression){
    case 1:
    //code
    break;
    case 2:
    //code
    break;
    case 3:
    //code
    break;
    default:
    //code 
    }
    
  25. For loop
  26. for(statement 1; statement 2; statement 3;){
    //your code goes header
    }
    
  27. While loop
  28. while(condition){
    //code
    }
    
  29. Do while loop
  30. do{
    //code
    i++;
    } while(condition);
    
  31. Random number
  32. Math.floor(Math.random()*100+1);
  33. Click
  34. elem.addEventListener('click',function(){
    //Code
    })
    
  35. Mouseenter
  36. elem.addEventListener('mouseenter',function(){
    //Code
    })
  37. Doubleclick
  38. elem.addEventListener('dblclick',function(){
    //Code
    })
  39. Mouseleave
  40. elem.addEventListener('mouseleave',function(){
    //Code
    })
  41. Mousemove
  42. elem.addEventListener('mousemove',function(){
    //Code
    })
  43. Keydown
  44. elem.addEventListener('keydown',function(){
    //Code
    })
  45. Keypress
  46. elem.addEventListener('keypress',function(){
    //Code
    })
  47. Keyup
  48. elem.addEventListener('keyup',function(){
    //Code
    })
  49. Alert
  50. alert()
  51. Blur
  52. blur()
  53. Setinterval
  54. setInterval(()=>{
        //code
    },1000)
    
  55. Clearinterval
  56. clearInterval()
  57. Settimeout
  58. setTimeout(()=>{
        //code
    })
    
  59. Cleartimeout
  60. clearTimeout()
  61. Confirm
  62. confirm('Do you want to confirm');
  63. Open
  64. open('https://www.youtube.com');
  65. Prompt
  66. let username = prompt("what's your usename?");
  67. Scrollby
  68. scrollBy(50,0);
  69. ScrollTo
  70. scrollTo(300,0);
  71. Try and Catch
  72. try{
    //code to try
    }
    catch(err){
    //code to handle error
    }