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.

Adjusting the Padding of an Element-not mobile friendly

See original GitHub issue

Challenge Name

Adjusting the Padding of an Element https://www.freecodecamp.com/challenges/adjusting-the-padding-of-an-element

Issue Description

Using Chrome browser for Samsung Galaxy s5… Basically, while attempting to change the green table’s padding in this challenge, the padding size just shrinks and stays this way. It doesn’t seem to matter what value is placed in the code, the green padding just stays at the smaller size. This includes having the correct value of 20px; and thus, the test will spit back an error every time, even with the correct code. This issue seems to have been brought up several times, but closed every time with little to no real investigation. Several of these challenges have similar issues when attempted from a mobile platform. It’s frustrating not to be able to make progress when I don’t have a pc available…

Browser Information

  • Browser Name, Version: chrome 58.0.3029.83
  • Operating System: Android 6.0.1
  • Mobile, Desktop, or Tablet: mobile phone- Samsung Galaxy s5

Your Code



<style>
  .injected-text {
    margin-bottom: -25px;
    text-align: center;
  }

  .box {
    border-style: solid;
    border-color: black;
    border-width: 5px;
    text-align: center;
  }

  .yellow-box {
    background-color: yellow;
    padding: 10px;
  }
  
  .red-box {
    background-color: red;
    padding: 20px;
  }

  .green-box {
    background-color: green;
    padding: 20px;
  }
</style>
<h5 class="injected-text">margin</h5>

<div class="box yellow-box">
  <h5 class="box red-box">padding</h5>
  <h5 class="box green-box">padding</h5>
</div>


Screenshot

https://plus.google.com/109521751887572320207

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
cdgalvancommented, Jun 17, 2017

@tommygebru thanks for posting that screen shot, wasn’t quite sure the correct way to do that

0reactions
WilliamSpruytcommented, Jun 24, 2017

It is something to do with the white space before ‘padding’. I played around deleting some and was able to pass.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Set CSS Margins and Padding (And Cool Layout Tricks)
The trick is to set the height of the parent element to zero and its padding-top property to be equal to the value...
Read more >
css - how to make padding responsive in mobile view?
I am not sure why it's not entirely responsive when viewed in mobile view. Is there a code to fix this?
Read more >
Mobile Friendly Padding - three17design
If you add padding to your element, you have to change the width, and keeping track of all of that can be a...
Read more >
How To Adjust the Content, Padding, Border, and Margins of ...
Adjusting the Margin Size of an HTML Element With CSS​​ You can remove this margin by setting the top and left margin to...
Read more >
Responsive Padding, Margin & Gutters With CSS Calc
When creating a responsive layout, you're not just moving elements around the page to make them fit at every screen size. A user-friendly...
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