Back to Freecodecamp

Step 16

curriculum/challenges/english/blocks/workshop-greeting-card/673332a6b63f9f1e1f81ba9b.md

latest2.0 KB
Original Source

--description--

Now you can do something similar to add the emoji also after the title.

Create a selector that targets the pseudo-element ::after of the h1 element. Give it a content property and set its value to " 🥳" (note there is a space before the emoji).

--hints--

You should have an h1::after selector.

js
assert.exists(new __helpers.CSSHelp(document).getStyle("h1::after"));

The h1::after selector should have a content property set to " 🥳".

js
assert.strictEqual(
  new __helpers.CSSHelp(document).getStyle("h1::after")?.getPropertyValue("content"),
  `" 🥳"`
);

--seed--

--seed-contents--

html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Greeting Card</title>
    <link href="styles.css" rel="stylesheet">
  </head>
  <body>
    <div class="card" id="greeting-card">
      <h1>Happy Birthday!</h1>
      <p class="message">
        Wishing you all the happiness and joy on your special day!
      </p>
      <div class="card-links">
        <a href="#send" class="send-link">Send Card</a>
        <a href="#share" class="share-link">Share on Social Media</a>
      </div>
  	</div>
    <section id="send">
      <h2>Sending your card...</h2>
      <p>Card successfully sent to your recipient!</p>
    </section>
    <section id="share">
      <h2>Sharing your card...</h2>
      <p>Your card was shared on social media!</p>
    </section>
  </body>
</html>
css
body {
  font-family: Arial, sans-serif;
  padding: 40px;
  text-align: center;
  background-color: brown;
}

.card {
  background-color: white;
  max-width: 400px;
  padding: 40px;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 4px 8px gray;
  transition: transform 0.3s, background-color 0.3s ease
}

.card:hover {
  background-color: khaki;
  transform: scale(1.1);
}

h1::before {
  content: "🥳 ";
}

--fcc-editable-region--

--fcc-editable-region--