question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change the Font Size of an Element. 100% zoom in the browser, still won't work.

See original GitHub issue

I have this code, which should pass the tests:

<style>
  .red-text {
    color: red;
  }
  p{
    font-size: 16 px;
  }
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p class="red-text">Purr jump eat the grass</p>
<p>Purr jump eat the grass</p>

It still won’t pass. I’m using firefox.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
georgebakeruscommented, Mar 26, 2016

@GuominWu the . means “for elements with a class of this name, apply this style”. Writing .p{style} means “apply this style to elements with class named p” . So for example the style will be applied to <h2 class=p> some_header2_content </h2>

Without the period, writing p {style...}means “apply this style to all p elements”. So for example the style will be applied to

<p>some_paragraph_text</p>
<p class=red-text>more_text</p>

and all other <p elements

1reaction
ghostcommented, Mar 26, 2016

@kikenz the .red-text class and the element p attribute should be on separate lines with separate curly braces.

@GouminWu Because the p is an element, not a class. Elements do not get the dot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why the font size won't change with browser zoom in?
Fonts using a specific pixel size are not relative (along with several others). Zooming changes that relative information.
Read more >
Change the Font Size of an Element. 100% zoom in ... - GitHub
100% zoom in the browser, still won't work. #7658 ... The issue is where you're setting the font-size . You're setting it to...
Read more >
Changing font size and text zoom to 100%?
I can resolve this last step: -Between the style tags, give the p elements font-size of 16px. Browser and Text zoom should be...
Read more >
Change text, image, and video sizes (zoom) - Google Support
Change everything: Next to "Page zoom," click the Down arrow Down arrow . Then select the zoom option you want. · Change font...
Read more >
Font Size Problems? Check Here First! - Codecademy
If you find you're getting a really weird font-size reported back to you, such as 18.1818181818px , the problem is that your browser's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found