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.

I have the width set to 100 px, not sure why it is not passing. Help Appreciated.

See original GitHub issue

Challenge Size your Images has an issue. User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36. Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:


<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;

  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;

    .smaller-image {
       width: 100px;
    }
  }
</style>

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

<img src="https://bit.ly/fcc-relaxing-cat" class="smaller-image">

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
texas2010commented, Jul 12, 2016

@mack318, you forget to create class in img element.

1reaction
arkucommented, Jul 6, 2016

It’s not a bug with the site, but with your code.

 p {
    font-size: 16px;
    font-family: Monospace;

    .smaller-image {
       width: 100px;
    }
  }

See, you have nested the .smaller-image inside p. This is not a valid CSS rule and this style of nesting is only used in preprocessors like LESS and SASS. The challenge is to get you practise writing classes and applying them to your html elements. The test only checks whether the width of the image is 100px and not whether you used classes or inline styling to achieve that. However, Inline styling is not a good practice and you should avoid using it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Div width 100% minus fixed amount of pixels - Stack Overflow
New way I've just stumbled upon: css calc() : .calculated-width { width: -webkit-calc(100% - 100px); width: -moz-calc(100% - 100px); width: ...
Read more >
What Does "width: 100%" Do in CSS? - Impressive Webs
A look at what it means to set an element to width: 100% in CSS and when this sort of thing would be...
Read more >
[Solved] Website div width 100% not working on mobile
On a desktop browser (Google Chrome) it is working fine, but on mobile browser (Chrome again), the slides (gray and white) seem to...
Read more >
Datatables `width: 100%` being overwritten by `scrollX : true`
I have an issue with Datatables not setting the width as expected. Please view the image below. The Datatable does not set the...
Read more >
CSS Fixed Headers & Footers Tutorial - YouTube
Is your CSS Width 100 % setting NOT working? This is a common problem with CSS position fixed headers and footers.
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