FAQ: CSS Functions - Calculating Values

This community-built FAQ covers the “Calculating Values” exercise from the lesson “CSS Functions”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn Intermediate CSS

FAQs on the exercise Calculating Values

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!
You can also find further discussion and get answers to your questions over in Language Help.

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head to Language Help and Tips and Resources. If you are wanting feedback or inspiration for a project, check out Projects.

Looking for motivation to keep learning? Join our wider discussions in Community

Learn more about how to use this guide.

Found a bug? Report it online, or post in Bug Reporting

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Hi ! can someone explain a bit what is the viewport ? i am having difficulties to understand it plainly… thanks ! :slight_smile:

1 Like

If you can read this thank your viewport !! Hopefully you figured it out and weren’t infinitely stuck but the viewport is the screen you are using to view something render like a iphone/tablet/laptop. It is also not the view of the entire website because we’re only getting a small glimpse of the page aka we got to scroll up or scroll down. They all have various different sizes. But maybe go on and review some stuff before heading on out further. Some of the stuff depends on understanding different screen formats in the CSS unit.

Here’s a super more in depth explanation.
Viewport concepts - CSS: Cascading Style Sheets | MDN viewport was originally 1200 x 800 pixels.,measurement when we zoomed in using the keyboard.

1 Like

I also forgot to add a viewport is also a unit of measurement to if that’s what you mean you’ll see it in examples abbreviated as vw if that’s what you mean.

1 Like

In Step 2 (shown below), why don’t we just set left to 10% instead of using calc(50% - 40%)?
Screenshot 2022-09-15 154758

2 Likes

Hi @firebreather65, @ngwolfhare, and to others who possibly understand the concept.

Have you figured it out?
I have the same question as you!

I mean,
why are we using ‘left: 50%’ Subtract ‘half of the width’ (40% in this case) to center the texts?

left: calc(50% - 40%);

I am having difficulties to understand.

This lesson is in Learn the CSS Functions - Calculating Values, page 3 / 9

thanks!

One wonders if that is so there is a 5% margin on each side?

1 Like