Stuck on Final Point on [Front End Development Libraries Projects - Build a Random Quote Machine]

Hi!
I can’t for the life of me get the final point of the rules to pass. The code is very basic and i’m still juts trying to get the rules to pass before I start refining it, but I just can’t figure out what to do to center said div horizontally. Every other rule is passing.

Here’s the message I get in red (meaning it does not pass):

#Layout

  • 1. The #quote-box wrapper element should be horizontally centered. Please run tests with browser’s zoom level at 100% and page maximized

And this is my code:

This is my first ever code outside of the FreeCodeCamp editor so I’m still finding my footing with GitHub and everything, so I’ll gladly answer any questions if something is not clear and would also gladly take advice or criticism on anything.

Thank you!

  1. Variable Initialization: In the script, you have a variable chosenNumber being assigned a value from quotes, but you don’t have a quotes array defined anywhere. You should be using quoteList instead.
  2. Chosen Quote and Author: The variables chosenQuote and chosenAuthor are assigned a value directly from the arrays. Instead, you should be using the chosenNumber index to get the quote and author from their respective arrays.
  3. Tweet Quote Link: The tweet quote link should include the actual quote and author in the text parameter for the tweet. You can achieve this by dynamically setting the href attribute of the tweet link.

As for the test that isn’t passing.

You are not centering the #quote-box element. For the auto margin to work the element must have a width (not auto or full-width) and you have to remove the position absolute.

#quote-box {
  margin: auto;
  max-width: 800px;
}

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.