DEV Community

Robson Muniz
Robson Muniz

Posted on


🎬Make a Joke Generator | HTML, CSS & javaScript🙌

Make a Make a Joke Generator | HTML, CSS & javaScript, step-by-step from SCRATCH…

Source Code:


<!DOCTYPE html>
<html lang="en">

  <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>Joke Generator</title>
  <link rel="stylesheet" href="style.css">
  <link rel="stylesheet" href="">

  <div class="main_container">
    <h3>Try Not To Laugh Challenge</h3>
    <div class="joke" id="₢">
      Here goes the joke!
    <button class="btn" id="₢">
      Get Another Joke
      <i class="fas fa-grin-squint-tears"></i>
  <script src="app.js"></script>


Enter fullscreen mode Exit fullscreen mode


@import url(';400;700&display=swap');

* {
    box-sizing: border-box;

body {
    background: url(img/bg.jpg) center center/cover no-repeat;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;

.main_container {
    background-color: #f6f1f4;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 6px 6px rgba(0, 0, 0, 0.1);
    padding: 50px 20px;
    max-width: 100%;
    width: 800px;
    text-align: center;

h3 {
    margin: 0;
    letter-spacing: 2px;
    opacity: 0.5;

.joke {
    font-size: 30px;
    color: #16110d;
    line-height: 40px;
    margin: 50px auto;
    max-width: 600px;
.btn {
    background-color: #9f68e0;
    border: 0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1), 0 6px 6px rgba(0, 0, 0, 0.1);
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    padding: 14px 40px;

.btn:active {
    transform: scale(.98);
.fas {
    margin-left: 4px;
Enter fullscreen mode Exit fullscreen mode

Top comments (0)


11 Tips That Make You a Better Typescript Programmer

1 Think in {Set}

Type is an everyday concept to programmers, but it’s surprisingly difficult to define it succinctly. I find it helpful to use Set as a conceptual model instead.

#2 Understand declared type and narrowed type

One extremely powerful typescript feature is automatic type narrowing based on control flow. This means a variable has two types associated with it at any specific point of code location: a declaration type and a narrowed type.

#3 Use discriminated union instead of optional fields


Read the whole post now!