Follow the instructions below to see what CSS can do!

Press the ‘Show me the code’ button below and when a popup appears, click on the ‘Copy code’ button. You can then close the popup and click on the ‘CSS’ tab in the big box below. Delete the /* Write CSS code here */ placeholder and simply paste the code here entirely to see it in action in the ‘Result tab’! If you are on your mobile, click on the ‘Result’ tab after pasting the code in the CSS field and then scroll down a bit and click the ‘Rerun’ button in the bottom right corner of the big box. Give it some time to update and see the result!

See the Pen Sample-exercise by Anait (@velvetmade) on CodePen.

General Instructions

Step One: What I will be making

First click on the green ‘What I will be making’ button. This is how your end result should look like.

Step Two: What I need

Next, click on the ‘What I need’ button to get some basic parameters to use in the code. Such as the font family, colors, image URLs etc. These are just recommendations. Use your own judgement for the rest of the values, such as paddings, margins, spacing and size.

Step Three: Read the given HTML code

You don’t need to know how to write HTML for these exercises. However, you WILL need to take a look at the ‘HTML’ code in the exercise. You can switch from HTML to CSS tab in the Codepen screen. Then read the built HTML code for each exercise to understand the structure and find the classes that are defined for the elements that you will be editing. Use those predefined classes to style them in CSS.

Step Four: Click on the ‘CSS’ tab and start coding

Click on the ‘CSS’ tab in the Codepen screen and start typing your CSS code here, just below the ‘Write CSS code here’ comment. You can also delete this comment if you wish.

For example, if a ‘div’ has a class “text-content” in HTML, you can then style this class in CSS tab. Just don’t forget to add a dot before calling a class out (.text-content)

You should see a live preview of the CSS code that you are editing in the ‘Result’ tab to the right of the Codepen screen.

Step Five: Check the solution with the CSS code

If you are stuck, click on the ‘Show me the code’ button. This will reveal the code that you can also completely copy and paste in the CSS tab of the exercise to see the result.

Or you can just go back to the lessons and watch them again.

Have fun and feel free to reach out!

Make the main container with the heading fit the screen height without the nav menu height
Use the overlay filter on the background image
Header height: 80px
Button color: #7CB9E8
Background image URL: https://www.cssgamelab.com/wp-content/uploads/2024/06/pexels-photo-254770.jpeg
Background color: #00308F
Font: Outfit
Accent color rgb: 255,83,73
Hover color rgb: 252, 70, 57
				
					.main-box{
  height: calc(100vh);
  background-color: #00308F;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: -2;
}

.main-box::before{
  content: '';
  background-image: url('https://www.cssgamelab.com/wp-content/uploads/2024/06/pexels-photo-254770.jpeg');
  position: absolute;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  mix-blend-mode: overlay;
  filter: grayscale(100%);
  opacity: 0.6;
  z-index: -1;
}

.main-box h1{
  margin: 0px;
  font-family: 'DM Serif Display', sans-serif;
  color: #ffffff;
  font-size: 15vw;
}

.button a{
  color: #0000cc;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  text-decoration: none;
  background-color: #ffffff;
  padding: 15px 25px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 15px;
}