Text viewport width

Hopefully someone can answer this. I added the the style for the h2 and p tags…h2 should be 80% of the viewport width and p 75% of the viewport’s smaller dimension. The code appears to work correctly BUT it doesn’t pass the run test… should I be using font-size: I don’t get why it doesn’t pass.

Thanks!!!

h2 {font-size: 80vw;} p {font-size: 75vmin;}

Well what do the instructions say?

Set the width of the h2 tag to 80% of the viewport’s width and the width of the paragraph as 75% of the viewport’s smaller dimension.

challenge name: Responsive Web Design Principles: Make Typography Responsive

But you’re not setting the width.

well it seems to work it just doesn’t pass the test…if it’s not correct how do you code it??? thanks

the light dawns! thanks!!!

I seem to be having issues with this same challenge. instructions: Set the width of the h2 tag to 80% of the viewport's width and the width of the paragraph as 75% of the viewport's smaller dimension.

This is my code:

<style>
  h2 {
    width: 80vw;
  }
  
  P {
    width: 75vmin;
  }
</style>

Not sure what the issue is. Is this a bug?

edit: not sure why but if I write the code for only one element, the p tag for example, it’ll be checked off ok. But If I try to include both selectors, the one that comes second will not check off even though it works when it’s the only one. Strange.

Hi everyone. The problem is the uppercase P. If you try it with a lower case p (instead of P), the tests pass. It worked for me!

1 Like

Indeed, the test is too strict. I’ve submitted a code change proposal, so hopefully others won’t be able to hit the same problem soon.

@cdnicholson an u pls send the screenshot of the code , im still not able to pass this test

it has worked for me @cdnicholson… no need of screenshot… thanks